00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <stdlib.h>
00040 #include <stdio.h>
00041
00042 #include "OSGConfig.h"
00043
00044 #include <OSGDrawAction.h>
00045 #include <OSGRenderAction.h>
00046 #include <OSGIntersectAction.h>
00047
00048 #include "OSGGroup.h"
00049
00050 OSG_USING_NAMESPACE
00051
00060
00061
00062
00063 void Group::changed(BitVector whichField, UInt32 origin)
00064 {
00065 Inherited::changed(whichField, origin);
00066 }
00067
00068
00069
00070
00071 void Group::dump( UInt32 uiIndent,
00072 const BitVector bvFlags) const
00073 {
00074 Inherited::dump(uiIndent, bvFlags);
00075 }
00076
00077
00078
00079
00080 Group::Group(void) :
00081 Inherited()
00082 {
00083 }
00084
00085 Group::Group(const Group &source) :
00086 Inherited(source)
00087 {
00088 }
00089
00090
00091
00092
00093 Group::~Group(void)
00094 {
00095 }
00096
00097
00098
00099
00100 Action::ResultE Group::drawEnter(Action *action)
00101 {
00102 DrawActionBase *da = dynamic_cast<DrawActionBase *>(action);
00103
00104 if(da->selectVisibles() == 0)
00105 return Action::Skip;
00106
00107 return Action::Continue;
00108 }
00109
00110 Action::ResultE Group::drawLeave(Action *)
00111 {
00112 return Action::Continue;
00113 }
00114
00115
00116
00117
00118 Action::ResultE Group::renderEnter(Action *action)
00119 {
00120 RenderAction *ra = dynamic_cast<RenderAction *>(action);
00121
00122 if (ra->pushVisibility())
00123 {
00124 if(ra->selectVisibles() == 0)
00125 {
00126 ra->popVisibility();
00127 return Action::Skip;
00128 }
00129 }
00130
00131 return Action::Continue;
00132 }
00133
00134 Action::ResultE Group::renderLeave(Action *action)
00135 {
00136 RenderAction *ra = dynamic_cast<RenderAction *>(action);
00137
00138 ra->popVisibility();
00139
00140 return Action::Continue;
00141 }
00142
00143
00144
00145
00146 Action::ResultE Group::intersect(Action *action)
00147 {
00148 IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
00149 const DynamicVolume &dv = ia->getActNode()->getVolume();
00150
00151 if(dv.isValid() && ! dv.intersect(ia->getLine()))
00152 {
00153 return Action::Skip;
00154 }
00155
00156 return Action::Continue;
00157 }
00158
00159
00160
00161
00162 void Group::initMethod (void)
00163 {
00164 DrawAction::registerEnterDefault(
00165 getClassType(),
00166 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00167 GroupPtr ,
00168 CNodePtr ,
00169 Action *>(&Group::drawEnter));
00170 DrawAction::registerLeaveDefault(
00171 getClassType(),
00172 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00173 GroupPtr ,
00174 CNodePtr ,
00175 Action *>(&Group::drawLeave));
00176
00177 RenderAction::registerEnterDefault(
00178 getClassType(),
00179 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00180 GroupPtr ,
00181 CNodePtr ,
00182 Action *>(&Group::renderEnter));
00183
00184 RenderAction::registerLeaveDefault(
00185 getClassType(),
00186 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00187 GroupPtr ,
00188 CNodePtr ,
00189 Action *>(&Group::renderLeave));
00190
00191 IntersectAction::registerEnterDefault(
00192 getClassType(),
00193 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00194 GroupPtr ,
00195 CNodePtr ,
00196 Action *>(&Group::intersect));
00197 }
00198
00199
00200
00201
00202
00203 #ifdef __sgi
00204 #pragma set woff 1174
00205 #endif
00206
00207 #ifdef OSG_LINUX_ICC
00208 #pragma warning( disable : 177 )
00209 #endif
00210
00211 namespace
00212 {
00213 static Char8 cvsid_cpp[] = "@(#)$Id: $";
00214 static Char8 cvsid_hpp[] = OSGGROUP_HEADER_CVSID;
00215 static Char8 cvsid_inl[] = OSGGROUP_INLINE_CVSID;
00216 }
00217
00218
00219
00220
00221