21#include "vselectobjects.h"
35 if( m_rectMode && m_rect.isEmpty() )
37 visitVObject( composite );
41 bool selected =
false;
73 path.moveTo( m_rect.topLeft() );
74 path.lineTo( m_rect.topRight() );
82 path.getFirst()->
setKnot( m_rect.bottomRight() );
90 path.getLast()->
setKnot( m_rect.bottomLeft() );
98 path.getFirst()->
setKnot( m_rect.topLeft() );
120 if( ! m_selection.containsRef( &composite ) )
121 m_selection.append( &composite );
126 m_selection.remove( &composite );
134VSelectObjects::visitVObject(
VObject&
object )
144 if( !m_rect.isEmpty() )
148 if( m_rect.intersects(
object.boundingBox() ) )
151 if( ! m_selection.containsRef( &
object ) )
152 m_selection.append( &
object );
158 if( m_rect.intersects(
object.boundingBox() ) )
161 m_selection.remove( &
object );
171 if( ! m_selection.containsRef( &
object ) )
172 m_selection.append( &
object );
178 m_selection.remove( &
object );
186 if(
object.boundingBox().contains( m_point ) )
191 if( ! m_selection.containsRef( &
object ) )
192 m_selection.append( &
object );
197 m_selection.remove( &
object );
215 VObjectListIterator itr( layer.
objects() );
216 for( ; itr.current(); ++itr )
217 itr.current()->accept( *
this );
229 int deselectedGlyphs = 0;
231 VPathListIterator itr( text.glyphs() );
232 for( ; itr.current(); ++itr )
239 kdDebug(38000) <<
"selected: " << itr.current() << endl;
240 m_selection.remove( &c );
242 if( ! m_selection.containsRef( &text ) )
243 m_selection.append( &text );
248 kdDebug(38000) <<
"deselected: " << itr.current() << endl;
252 if( deselectedGlyphs >= 0 && uint( deselectedGlyphs ) == text.glyphs().count() )
255 m_selection.remove( &text );
267 if( ! m_insideGroups )
268 visitVObject( group );
All non-visual, static doc info is in here.
VLayer * activeLayer() const
Returns a pointer to the active layer.
@ AllLayers
selection within all layers
@ ActiveLayer
selection within the active layer
@ VisibleLayers
selection within all visible layers
@ SelectedLayers
selection within all selected layers
VSelectionMode selectionMode()
Returns the selection mode.
Base class for all sort of VObject conglomerats.
const VObjectList & objects() const
Read only access to the grouped objects.
VLayer manages a set of vobjects.
bool selected()
Returns the selection state of the layer.
The base class for all karbon objects.
virtual void setState(const VState state)
Sets the state to a specified new state.
VObject * parent() const
Returns pointer to current parent object.
@ normal_locked
visible, but locked (r/o)
@ selected
visible, active and can be manipulated by tools
@ deleted
deleted, nearly dead
@ normal
visible, not active
VState state() const
Get the state the object is in.
A composite path consists of one or many subpaths.
void combine(const VPath &path)
Combines two composite paths.
bool pointIsInside(const KoPoint &p) const
Returns true if point p is located inside the composite.
bool intersects(const VSegment &segment) const
Returns true if the segment intersects this composite.
virtual const KoRect & boundingBox() const
Calculates the tightest bounding box around the object.
void setKnot(const KoPoint &p)
Sets the knot.
virtual void visitVGroup(VGroup &group)
Visit method for a VGroup.
virtual void visitVLayer(VLayer &layer)
Visit method for a VLayer.
virtual void visitVPath(VPath &composite)
Visit method for a VPath.
virtual void visitVText(VText &text)
Visit method for a VText.
VSubpath provides a sophisticated list of VSegment.
virtual void visitVGroup(VGroup &group)
Visit method for a VGroup.
void setSuccess(bool success=true)
Set the success property.