1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class IntersectProxyAttachment!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
66 #include "OSGIntersectProxyAttachmentBase.h"
67 #include "OSGIntersectProxyAttachment.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::IntersectProxyAttachment
78 Base class for attachments that proxy the intersect testing for the
79 core they are attached to or the whole hierarchy below them.
80 This attachment should be attached to nodes.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var bool IntersectProxyAttachmentBase::_sfVisitChildren
88 Controls if the intersect should visit children of the node this
90 If true, the attachment is effectively a proxy for the core of the
91 node. If false, the attachment is a proxy for the whole hierarchy
96 /***************************************************************************\
97 * FieldType/FieldTrait Instantiation *
98 \***************************************************************************/
100 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
101 PointerType FieldTraits
<IntersectProxyAttachment
*, nsOSG
>::_type(
102 "IntersectProxyAttachmentPtr",
104 IntersectProxyAttachment::getClassType(),
108 OSG_FIELDTRAITS_GETTYPE_NS(IntersectProxyAttachment
*, nsOSG
)
110 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
111 IntersectProxyAttachment
*,
115 /***************************************************************************\
116 * Field Description *
117 \***************************************************************************/
119 void IntersectProxyAttachmentBase::classDescInserter(TypeObject
&oType
)
121 FieldDescriptionBase
*pDesc
= NULL
;
124 pDesc
= new SFBool::Description(
125 SFBool::getClassType(),
127 "Controls if the intersect should visit children of the node this\n"
129 "If true, the attachment is effectively a proxy for the core of the\n"
130 "node. If false, the attachment is a proxy for the whole hierarchy\n"
132 VisitChildrenFieldId
, VisitChildrenFieldMask
,
134 (Field::SFDefaultFlags
| Field::FStdAccess
),
135 static_cast<FieldEditMethodSig
>(&IntersectProxyAttachment::editHandleVisitChildren
),
136 static_cast<FieldGetMethodSig
>(&IntersectProxyAttachment::getHandleVisitChildren
));
138 oType
.addInitialDesc(pDesc
);
142 IntersectProxyAttachmentBase::TypeObject
IntersectProxyAttachmentBase::_type(
143 IntersectProxyAttachmentBase::getClassname(),
144 Inherited::getClassname(),
145 "IntersectProxyAttachment",
148 reinterpret_cast<InitContainerF
>(&IntersectProxyAttachment::initMethod
),
149 reinterpret_cast<ExitContainerF
>(&IntersectProxyAttachment::exitMethod
),
150 reinterpret_cast<InitalInsertDescFunc
>(
151 reinterpret_cast<void *>(&IntersectProxyAttachment::classDescInserter
)),
154 "<?xml version=\"1.0\"?>\n"
157 " name=\"IntersectProxyAttachment\"\n"
158 " parent=\"Attachment\"\n"
159 " library=\"System\"\n"
160 " pointerfieldtypes=\"single\"\n"
161 " structure=\"abstract\"\n"
162 " systemcomponent=\"true\"\n"
163 " parentsystemcomponent=\"true\"\n"
164 " decoratable=\"false\"\n"
165 " useLocalIncludes=\"false\"\n"
166 " docGroupBase=\"GrpSystemFieldContainer\"\n"
168 " Base class for attachments that proxy the intersect testing for the\n"
169 " core they are attached to or the whole hierarchy below them.\n"
170 " This attachment should be attached to nodes.\n"
173 " name=\"visitChildren\"\n"
175 " category=\"data\"\n"
176 " cardinality=\"single\"\n"
177 " visibility=\"external\"\n"
178 " access=\"public\"\n"
179 " defaultValue=\"true\"\n"
181 " Controls if the intersect should visit children of the node this\n"
183 " If true, the attachment is effectively a proxy for the core of the\n"
184 " node. If false, the attachment is a proxy for the whole hierarchy\n"
188 "</FieldContainer>\n",
189 "Base class for attachments that proxy the intersect testing for the\n"
190 "core they are attached to or the whole hierarchy below them.\n"
191 "This attachment should be attached to nodes.\n"
194 /*------------------------------ get -----------------------------------*/
196 FieldContainerType
&IntersectProxyAttachmentBase::getType(void)
201 const FieldContainerType
&IntersectProxyAttachmentBase::getType(void) const
206 UInt32
IntersectProxyAttachmentBase::getContainerSize(void) const
208 return sizeof(IntersectProxyAttachment
);
211 /*------------------------- decorator get ------------------------------*/
214 SFBool
*IntersectProxyAttachmentBase::editSFVisitChildren(void)
216 editSField(VisitChildrenFieldMask
);
218 return &_sfVisitChildren
;
221 const SFBool
*IntersectProxyAttachmentBase::getSFVisitChildren(void) const
223 return &_sfVisitChildren
;
231 /*------------------------------ access -----------------------------------*/
233 SizeT
IntersectProxyAttachmentBase::getBinSize(ConstFieldMaskArg whichField
)
235 SizeT returnValue
= Inherited::getBinSize(whichField
);
237 if(FieldBits::NoField
!= (VisitChildrenFieldMask
& whichField
))
239 returnValue
+= _sfVisitChildren
.getBinSize();
245 void IntersectProxyAttachmentBase::copyToBin(BinaryDataHandler
&pMem
,
246 ConstFieldMaskArg whichField
)
248 Inherited::copyToBin(pMem
, whichField
);
250 if(FieldBits::NoField
!= (VisitChildrenFieldMask
& whichField
))
252 _sfVisitChildren
.copyToBin(pMem
);
256 void IntersectProxyAttachmentBase::copyFromBin(BinaryDataHandler
&pMem
,
257 ConstFieldMaskArg whichField
)
259 Inherited::copyFromBin(pMem
, whichField
);
261 if(FieldBits::NoField
!= (VisitChildrenFieldMask
& whichField
))
263 editSField(VisitChildrenFieldMask
);
264 _sfVisitChildren
.copyFromBin(pMem
);
271 /*------------------------- constructors ----------------------------------*/
273 IntersectProxyAttachmentBase::IntersectProxyAttachmentBase(void) :
275 _sfVisitChildren (bool(true))
279 IntersectProxyAttachmentBase::IntersectProxyAttachmentBase(const IntersectProxyAttachmentBase
&source
) :
281 _sfVisitChildren (source
._sfVisitChildren
)
286 /*-------------------------- destructors ----------------------------------*/
288 IntersectProxyAttachmentBase::~IntersectProxyAttachmentBase(void)
293 GetFieldHandlePtr
IntersectProxyAttachmentBase::getHandleVisitChildren (void) const
295 SFBool::GetHandlePtr
returnValue(
296 new SFBool::GetHandle(
298 this->getType().getFieldDesc(VisitChildrenFieldId
),
299 const_cast<IntersectProxyAttachmentBase
*>(this)));
304 EditFieldHandlePtr
IntersectProxyAttachmentBase::editHandleVisitChildren (void)
306 SFBool::EditHandlePtr
returnValue(
307 new SFBool::EditHandle(
309 this->getType().getFieldDesc(VisitChildrenFieldId
),
313 editSField(VisitChildrenFieldMask
);
319 #ifdef OSG_MT_CPTR_ASPECT
320 void IntersectProxyAttachmentBase::execSyncV( FieldContainer
&oFrom
,
321 ConstFieldMaskArg whichField
,
322 AspectOffsetStore
&oOffsets
,
323 ConstFieldMaskArg syncMode
,
324 const UInt32 uiSyncInfo
)
326 IntersectProxyAttachment
*pThis
= static_cast<IntersectProxyAttachment
*>(this);
328 pThis
->execSync(static_cast<IntersectProxyAttachment
*>(&oFrom
),
338 void IntersectProxyAttachmentBase::resolveLinks(void)
340 Inherited::resolveLinks();