24#include "vdeletenodescmd.h"
25#include "vselection.h"
30VDeleteNodeCmd::VDeleteNodeCmd(
VDocument *doc )
31 :
VCommand( doc, i18n(
"Delete Node" ) )
35VDeleteNodeCmd::~VDeleteNodeCmd()
40VDeleteNodeCmd::visitVSubpath(
VSubpath& path )
42 VSegment* segment = path.first();
49 segment->
setState( VSegment::deleted );
50 m_segments.append( segment );
52 segment = segment->
next();
54 if( m_segments.count() > 0 )
61 VObjectListIterator itr(
document()->selection()->objects() );
63 for( ; itr.current() ; ++itr )
64 visit( *itr.current() );
72 TQPtrListIterator<VSegment> itr( m_segments );
73 for( ; itr.current() ; ++itr )
74 itr.current()->setState( VSegment::normal );
The base class for all karbon commands.
virtual void unexecute()
Unexecutes the command.
VDocument * document() const
Returns the document the command works on.
virtual void execute()=0
Executes the command.
All non-visual, static doc info is in here.
void invalidateBoundingBox()
Invalidates the bounding box, so it has to be recalculated.
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.
virtual bool visit(VObject &object)
General visit method.
void setSuccess(bool success=true)
Set the success property.