karbon
vvisitor.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "vcomposite.h"
00022 #include "vdocument.h"
00023 #include "vgroup.h"
00024 #include "vlayer.h"
00025 #include "vpath.h"
00026 #include "vselection.h"
00027 #include "vvisitor.h"
00028 #include "vimage.h"
00029
00030 bool
00031 VVisitor::visit( VObject& object )
00032 {
00033 m_success = false;
00034
00035 object.accept( *this );
00036
00037 return m_success;
00038 }
00039
00040 void
00041 VVisitor::visitVDocument( VDocument& document )
00042 {
00043 VLayerListIterator itr( document.layers() );
00044
00045 for( ; itr.current(); ++itr )
00046 {
00047 itr.current()->accept( *this );
00048 }
00049 }
00050
00051 void
00052 VVisitor::visitVGroup( VGroup& group )
00053 {
00054 VObjectListIterator itr( group.objects() );
00055
00056 for( ; itr.current(); ++itr )
00057 {
00058 itr.current()->accept( *this );
00059 }
00060 }
00061
00062 void
00063 VVisitor::visitVLayer( VLayer& layer )
00064 {
00065 VObjectListIterator itr( layer.objects() );
00066
00067 for( ; itr.current(); ++itr )
00068 {
00069 itr.current()->accept( *this );
00070 }
00071 }
00072
00073 void
00074 VVisitor::visitVPath( VPath& composite )
00075 {
00076 VSubpathListIterator itr( composite.paths() );
00077
00078 for( ; itr.current(); ++itr )
00079 {
00080 if( !itr.current()->isEmpty() )
00081 itr.current()->accept( *this );
00082 }
00083 }
00084
00085 void
00086 VVisitor::visitVSubpath( VSubpath& )
00087 {
00088 }
00089
00090 void
00091 VVisitor::visitVSelection( VSelection& selection )
00092 {
00093 VObjectListIterator itr( selection.objects() );
00094
00095 for( ; itr.current() ; ++itr )
00096 {
00097 itr.current()->accept( *this );
00098 }
00099 }
00100
00101 void
00102 VVisitor::visitVText( VText& )
00103 {
00104 }
00105
00106 void
00107 VVisitor::visitVImage( VImage& )
00108 {
00109 }
00110
00111 void
00112 VVisitor::visitVObject( VObject& )
00113 {
00114 }
|