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 ra->pushVisibility();
00123
00124 return Action::Continue;
00125 }
00126
00127 Action::ResultE Group::renderLeave(Action *action)
00128 {
00129 RenderAction *ra = dynamic_cast<RenderAction *>(action);
00130
00131 ra->popVisibility();
00132
00133 return Action::Continue;
00134 }
00135
00136
00137
00138
00139 Action::ResultE Group::intersect(Action *action)
00140 {
00141 IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
00142 const DynamicVolume &dv = ia->getActNode()->getVolume();
00143
00144 if(dv.isValid() && ! dv.intersect(ia->getLine()))
00145 {
00146 return Action::Skip;
00147 }
00148
00149 return Action::Continue;
00150 }
00151
00152
00153
00154
00155 void Group::initMethod (void)
00156 {
00157 DrawAction::registerEnterDefault(
00158 getClassType(),
00159 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00160 GroupPtr ,
00161 CNodePtr ,
00162 Action *>(&Group::drawEnter));
00163 DrawAction::registerLeaveDefault(
00164 getClassType(),
00165 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00166 GroupPtr ,
00167 CNodePtr ,
00168 Action *>(&Group::drawLeave));
00169
00170 RenderAction::registerEnterDefault(
00171 getClassType(),
00172 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00173 GroupPtr ,
00174 CNodePtr ,
00175 Action *>(&Group::renderEnter));
00176
00177 RenderAction::registerLeaveDefault(
00178 getClassType(),
00179 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00180 GroupPtr ,
00181 CNodePtr ,
00182 Action *>(&Group::renderLeave));
00183
00184 IntersectAction::registerEnterDefault(
00185 getClassType(),
00186 osgTypedMethodFunctor2BaseCPtrRef<Action::ResultE,
00187 GroupPtr ,
00188 CNodePtr ,
00189 Action *>(&Group::intersect));
00190 }
00191
00192
00193
00194
00195
00196 #ifdef __sgi
00197 #pragma set woff 1174
00198 #endif
00199
00200 #ifdef OSG_LINUX_ICC
00201 #pragma warning( disable : 177 )
00202 #endif
00203
00204 namespace
00205 {
00206 static Char8 cvsid_cpp[] = "@(#)$Id: $";
00207 static Char8 cvsid_hpp[] = OSGGROUP_HEADER_CVSID;
00208 static Char8 cvsid_inl[] = OSGGROUP_INLINE_CVSID;
00209 }
00210
00211
00212
00213
00214