24#include "vdeletenodescmd.h"
25#include "vselection.h"
30VDeleteNodeCmd::VDeleteNodeCmd(
VDocument *doc )
31 :
VCommand( doc, i18n(
"Delete Node" ) )
35VDeleteNodeCmd::~VDeleteNodeCmd()
40VDeleteNodeCmd::visitVSubpath(
VSubpath& path )
49 segment->
setState( VSegment::deleted );
50 m_segments.append( segment );
52 segment = segment->
next();
54 if( m_segments.count() > 0 )
59VDeleteNodeCmd::execute()
61 VObjectListIterator itr( document()->selection()->objects() );
63 for( ; itr.current() ; ++itr )
64 visit( *itr.current() );
66 setSuccess( m_segments.count() > 0 );
70VDeleteNodeCmd::unexecute()
72 TQPtrListIterator<VSegment> itr( m_segments );
73 for( ; itr.current() ; ++itr )
74 itr.current()->setState( VSegment::normal );
The base class for all karbon commands.
All non-visual, static doc info is in here.
void invalidateBoundingBox()
Invalidates the bounding box, so it has to be recalculated.
A class representing lines and beziers.
bool knotIsSelected() const
Returns true if the knot is selected.
VSegment * next() const
Returns a pointer to the next not deleted segment, if stored in a VSubpath.
void setState(VState state)
Sets the segment state.
VState state() const
Returns the segment state.
VSubpath provides a sophisticated list of VSegment.