changed: gcc8 base update
[opensg.git] / Source / System / FieldContainer / Attachments / OSGIntersectProxyAttachmentBase.cpp
blobce603d06a6943729a698fce7016d1c90082a5ecf
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class IntersectProxyAttachment!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGIntersectProxyAttachmentBase.h"
67 #include "OSGIntersectProxyAttachment.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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
89 is attached to.
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
92 below the node.
96 /***************************************************************************\
97 * FieldType/FieldTrait Instantiation *
98 \***************************************************************************/
100 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
101 PointerType FieldTraits<IntersectProxyAttachment *, nsOSG>::_type(
102 "IntersectProxyAttachmentPtr",
103 "AttachmentPtr",
104 IntersectProxyAttachment::getClassType(),
105 nsOSG);
106 #endif
108 OSG_FIELDTRAITS_GETTYPE_NS(IntersectProxyAttachment *, nsOSG)
110 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
111 IntersectProxyAttachment *,
112 nsOSG)
115 /***************************************************************************\
116 * Field Description *
117 \***************************************************************************/
119 void IntersectProxyAttachmentBase::classDescInserter(TypeObject &oType)
121 FieldDescriptionBase *pDesc = NULL;
124 pDesc = new SFBool::Description(
125 SFBool::getClassType(),
126 "visitChildren",
127 "Controls if the intersect should visit children of the node this\n"
128 "is attached to.\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"
131 "below the node.\n",
132 VisitChildrenFieldId, VisitChildrenFieldMask,
133 false,
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",
146 nsOSG, //Namespace
147 NULL,
148 reinterpret_cast<InitContainerF>(&IntersectProxyAttachment::initMethod),
149 reinterpret_cast<ExitContainerF>(&IntersectProxyAttachment::exitMethod),
150 reinterpret_cast<InitalInsertDescFunc>(
151 reinterpret_cast<void *>(&IntersectProxyAttachment::classDescInserter)),
152 false,
154 "<?xml version=\"1.0\"?>\n"
155 "\n"
156 "<FieldContainer\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"
167 " >\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"
171 "\n"
172 " <Field\n"
173 " name=\"visitChildren\"\n"
174 " type=\"bool\"\n"
175 " category=\"data\"\n"
176 " cardinality=\"single\"\n"
177 " visibility=\"external\"\n"
178 " access=\"public\"\n"
179 " defaultValue=\"true\"\n"
180 " >\n"
181 " Controls if the intersect should visit children of the node this\n"
182 " is attached to.\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"
185 " below the node.\n"
186 " </Field>\n"
187 "\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)
198 return _type;
201 const FieldContainerType &IntersectProxyAttachmentBase::getType(void) const
203 return _type;
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();
242 return returnValue;
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) :
274 Inherited(),
275 _sfVisitChildren (bool(true))
279 IntersectProxyAttachmentBase::IntersectProxyAttachmentBase(const IntersectProxyAttachmentBase &source) :
280 Inherited(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(
297 &_sfVisitChildren,
298 this->getType().getFieldDesc(VisitChildrenFieldId),
299 const_cast<IntersectProxyAttachmentBase *>(this)));
301 return returnValue;
304 EditFieldHandlePtr IntersectProxyAttachmentBase::editHandleVisitChildren (void)
306 SFBool::EditHandlePtr returnValue(
307 new SFBool::EditHandle(
308 &_sfVisitChildren,
309 this->getType().getFieldDesc(VisitChildrenFieldId),
310 this));
313 editSField(VisitChildrenFieldMask);
315 return returnValue;
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),
329 whichField,
330 oOffsets,
331 syncMode,
332 uiSyncInfo);
334 #endif
338 void IntersectProxyAttachmentBase::resolveLinks(void)
340 Inherited::resolveLinks();
346 OSG_END_NAMESPACE