changed: gcc8 base update
[opensg.git] / Source / Contrib / Manipulators / OSGManipulatorBase.h
blobcc9253dc125148a56dddc5645a95c31b5bf66f9c
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 Manipulator
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGMANIPULATORBASE_H_
55 #define _OSGMANIPULATORBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGContribGUIDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGTransform.h" // Parent
68 #include "OSGNodeFields.h" // Target type
69 #include "OSGSysFields.h" // EnablePivot type
70 #include "OSGVecFields.h" // LastMousePos type
71 #include "OSGViewportFields.h" // Viewport type
72 #include "OSGMaterialFields.h" // MaterialX type
74 #include "OSGManipulatorFields.h"
76 OSG_BEGIN_NAMESPACE
79 class Manipulator;
81 //! \brief Manipulator Base Class.
83 class OSG_CONTRIBGUI_DLLMAPPING ManipulatorBase : public Transform
85 public:
87 typedef Transform Inherited;
88 typedef Transform ParentContainer;
90 typedef Inherited::TypeObject TypeObject;
91 typedef TypeObject::InitPhase InitPhase;
93 OSG_GEN_INTERNALPTR(Manipulator);
95 /*========================== PUBLIC =================================*/
97 public:
99 enum
101 TargetFieldId = Inherited::NextFieldId,
102 EnablePivotFieldId = TargetFieldId + 1,
103 ActiveSubHandleFieldId = EnablePivotFieldId + 1,
104 LastMousePosFieldId = ActiveSubHandleFieldId + 1,
105 ViewportFieldId = LastMousePosFieldId + 1,
106 ActiveFieldId = ViewportFieldId + 1,
107 LengthFieldId = ActiveFieldId + 1,
108 PivotFieldId = LengthFieldId + 1,
109 HandleXNodeFieldId = PivotFieldId + 1,
110 HandleYNodeFieldId = HandleXNodeFieldId + 1,
111 HandleZNodeFieldId = HandleYNodeFieldId + 1,
112 HandlePNodeFieldId = HandleZNodeFieldId + 1,
113 TransXNodeFieldId = HandlePNodeFieldId + 1,
114 TransYNodeFieldId = TransXNodeFieldId + 1,
115 TransZNodeFieldId = TransYNodeFieldId + 1,
116 PivotNodeFieldId = TransZNodeFieldId + 1,
117 MaterialXFieldId = PivotNodeFieldId + 1,
118 MaterialYFieldId = MaterialXFieldId + 1,
119 MaterialZFieldId = MaterialYFieldId + 1,
120 MaterialPivotFieldId = MaterialZFieldId + 1,
121 AxisLinesNFieldId = MaterialPivotFieldId + 1,
122 NextFieldId = AxisLinesNFieldId + 1
125 static const OSG::BitVector TargetFieldMask =
126 (TypeTraits<BitVector>::One << TargetFieldId);
127 static const OSG::BitVector EnablePivotFieldMask =
128 (TypeTraits<BitVector>::One << EnablePivotFieldId);
129 static const OSG::BitVector ActiveSubHandleFieldMask =
130 (TypeTraits<BitVector>::One << ActiveSubHandleFieldId);
131 static const OSG::BitVector LastMousePosFieldMask =
132 (TypeTraits<BitVector>::One << LastMousePosFieldId);
133 static const OSG::BitVector ViewportFieldMask =
134 (TypeTraits<BitVector>::One << ViewportFieldId);
135 static const OSG::BitVector ActiveFieldMask =
136 (TypeTraits<BitVector>::One << ActiveFieldId);
137 static const OSG::BitVector LengthFieldMask =
138 (TypeTraits<BitVector>::One << LengthFieldId);
139 static const OSG::BitVector PivotFieldMask =
140 (TypeTraits<BitVector>::One << PivotFieldId);
141 static const OSG::BitVector HandleXNodeFieldMask =
142 (TypeTraits<BitVector>::One << HandleXNodeFieldId);
143 static const OSG::BitVector HandleYNodeFieldMask =
144 (TypeTraits<BitVector>::One << HandleYNodeFieldId);
145 static const OSG::BitVector HandleZNodeFieldMask =
146 (TypeTraits<BitVector>::One << HandleZNodeFieldId);
147 static const OSG::BitVector HandlePNodeFieldMask =
148 (TypeTraits<BitVector>::One << HandlePNodeFieldId);
149 static const OSG::BitVector TransXNodeFieldMask =
150 (TypeTraits<BitVector>::One << TransXNodeFieldId);
151 static const OSG::BitVector TransYNodeFieldMask =
152 (TypeTraits<BitVector>::One << TransYNodeFieldId);
153 static const OSG::BitVector TransZNodeFieldMask =
154 (TypeTraits<BitVector>::One << TransZNodeFieldId);
155 static const OSG::BitVector PivotNodeFieldMask =
156 (TypeTraits<BitVector>::One << PivotNodeFieldId);
157 static const OSG::BitVector MaterialXFieldMask =
158 (TypeTraits<BitVector>::One << MaterialXFieldId);
159 static const OSG::BitVector MaterialYFieldMask =
160 (TypeTraits<BitVector>::One << MaterialYFieldId);
161 static const OSG::BitVector MaterialZFieldMask =
162 (TypeTraits<BitVector>::One << MaterialZFieldId);
163 static const OSG::BitVector MaterialPivotFieldMask =
164 (TypeTraits<BitVector>::One << MaterialPivotFieldId);
165 static const OSG::BitVector AxisLinesNFieldMask =
166 (TypeTraits<BitVector>::One << AxisLinesNFieldId);
167 static const OSG::BitVector NextFieldMask =
168 (TypeTraits<BitVector>::One << NextFieldId);
170 typedef SFUnrecNodePtr SFTargetType;
171 typedef SFBool SFEnablePivotType;
172 typedef SFUnrecNodePtr SFActiveSubHandleType;
173 typedef SFPnt2f SFLastMousePosType;
174 typedef SFUnrecViewportPtr SFViewportType;
175 typedef SFBool SFActiveType;
176 typedef SFVec3f SFLengthType;
177 typedef SFPnt3f SFPivotType;
178 typedef SFUnrecNodePtr SFHandleXNodeType;
179 typedef SFUnrecNodePtr SFHandleYNodeType;
180 typedef SFUnrecNodePtr SFHandleZNodeType;
181 typedef SFUnrecNodePtr SFHandlePNodeType;
182 typedef SFUnrecNodePtr SFTransXNodeType;
183 typedef SFUnrecNodePtr SFTransYNodeType;
184 typedef SFUnrecNodePtr SFTransZNodeType;
185 typedef SFUnrecNodePtr SFPivotNodeType;
186 typedef SFUnrecMaterialPtr SFMaterialXType;
187 typedef SFUnrecMaterialPtr SFMaterialYType;
188 typedef SFUnrecMaterialPtr SFMaterialZType;
189 typedef SFUnrecMaterialPtr SFMaterialPivotType;
190 typedef SFUnrecNodePtr SFAxisLinesNType;
192 /*---------------------------------------------------------------------*/
193 /*! \name Class Get */
194 /*! \{ */
196 static FieldContainerType &getClassType (void);
197 static UInt32 getClassTypeId (void);
198 static UInt16 getClassGroupId(void);
200 /*! \} */
201 /*---------------------------------------------------------------------*/
202 /*! \name FieldContainer Get */
203 /*! \{ */
205 virtual FieldContainerType &getType (void);
206 virtual const FieldContainerType &getType (void) const;
208 virtual UInt32 getContainerSize(void) const;
210 /*! \} */
211 /*---------------------------------------------------------------------*/
212 /*! \name Field Get */
213 /*! \{ */
215 const SFUnrecNodePtr *getSFTarget (void) const;
216 SFUnrecNodePtr *editSFTarget (void);
218 SFBool *editSFEnablePivot (void);
219 const SFBool *getSFEnablePivot (void) const;
220 const SFUnrecNodePtr *getSFActiveSubHandle(void) const;
221 SFUnrecNodePtr *editSFActiveSubHandle(void);
222 const SFUnrecViewportPtr *getSFViewport (void) const;
223 SFUnrecViewportPtr *editSFViewport (void);
225 SFBool *editSFActive (void);
226 const SFBool *getSFActive (void) const;
228 SFVec3f *editSFLength (void);
229 const SFVec3f *getSFLength (void) const;
231 SFPnt3f *editSFPivot (void);
232 const SFPnt3f *getSFPivot (void) const;
233 const SFUnrecNodePtr *getSFHandleXNode (void) const;
234 SFUnrecNodePtr *editSFHandleXNode (void);
235 const SFUnrecNodePtr *getSFHandleYNode (void) const;
236 SFUnrecNodePtr *editSFHandleYNode (void);
237 const SFUnrecNodePtr *getSFHandleZNode (void) const;
238 SFUnrecNodePtr *editSFHandleZNode (void);
239 const SFUnrecNodePtr *getSFHandlePNode (void) const;
240 SFUnrecNodePtr *editSFHandlePNode (void);
241 const SFUnrecNodePtr *getSFTransXNode (void) const;
242 SFUnrecNodePtr *editSFTransXNode (void);
243 const SFUnrecNodePtr *getSFTransYNode (void) const;
244 SFUnrecNodePtr *editSFTransYNode (void);
245 const SFUnrecNodePtr *getSFTransZNode (void) const;
246 SFUnrecNodePtr *editSFTransZNode (void);
247 const SFUnrecNodePtr *getSFPivotNode (void) const;
248 SFUnrecNodePtr *editSFPivotNode (void);
249 const SFUnrecMaterialPtr *getSFMaterialX (void) const;
250 SFUnrecMaterialPtr *editSFMaterialX (void);
251 const SFUnrecMaterialPtr *getSFMaterialY (void) const;
252 SFUnrecMaterialPtr *editSFMaterialY (void);
253 const SFUnrecMaterialPtr *getSFMaterialZ (void) const;
254 SFUnrecMaterialPtr *editSFMaterialZ (void);
255 const SFUnrecMaterialPtr *getSFMaterialPivot (void) const;
256 SFUnrecMaterialPtr *editSFMaterialPivot (void);
257 const SFUnrecNodePtr *getSFAxisLinesN (void) const;
258 SFUnrecNodePtr *editSFAxisLinesN (void);
261 Node * getTarget (void) const;
263 bool &editEnablePivot (void);
264 bool getEnablePivot (void) const;
266 Node * getActiveSubHandle(void) const;
268 Viewport * getViewport (void) const;
270 bool &editActive (void);
271 bool getActive (void) const;
273 Vec3f &editLength (void);
274 const Vec3f &getLength (void) const;
276 Pnt3f &editPivot (void);
277 const Pnt3f &getPivot (void) const;
279 Node * getHandleXNode (void) const;
281 Node * getHandleYNode (void) const;
283 Node * getHandleZNode (void) const;
285 Node * getHandlePNode (void) const;
287 Node * getTransXNode (void) const;
289 Node * getTransYNode (void) const;
291 Node * getTransZNode (void) const;
293 Node * getPivotNode (void) const;
295 Material * getMaterialX (void) const;
297 Material * getMaterialY (void) const;
299 Material * getMaterialZ (void) const;
301 Material * getMaterialPivot (void) const;
303 Node * getAxisLinesN (void) const;
305 /*! \} */
306 /*---------------------------------------------------------------------*/
307 /*! \name Field Set */
308 /*! \{ */
310 void setTarget (Node * const value);
311 void setEnablePivot (const bool value);
312 void setActiveSubHandle(Node * const value);
313 void setViewport (Viewport * const value);
314 void setActive (const bool value);
315 void setLength (const Vec3f &value);
316 void setPivot (const Pnt3f &value);
317 void setHandleXNode (Node * const value);
318 void setHandleYNode (Node * const value);
319 void setHandleZNode (Node * const value);
320 void setHandlePNode (Node * const value);
321 void setTransXNode (Node * const value);
322 void setTransYNode (Node * const value);
323 void setTransZNode (Node * const value);
324 void setPivotNode (Node * const value);
325 void setMaterialX (Material * const value);
326 void setMaterialY (Material * const value);
327 void setMaterialZ (Material * const value);
328 void setMaterialPivot (Material * const value);
329 void setAxisLinesN (Node * const value);
331 /*! \} */
332 /*---------------------------------------------------------------------*/
333 /*! \name Ptr Field Set */
334 /*! \{ */
336 /*! \} */
337 /*---------------------------------------------------------------------*/
338 /*! \name Ptr MField Set */
339 /*! \{ */
341 /*! \} */
342 /*---------------------------------------------------------------------*/
343 /*! \name Binary Access */
344 /*! \{ */
346 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
347 virtual void copyToBin (BinaryDataHandler &pMem,
348 ConstFieldMaskArg whichField);
349 virtual void copyFromBin(BinaryDataHandler &pMem,
350 ConstFieldMaskArg whichField);
353 /*! \} */
354 /*========================= PROTECTED ===============================*/
356 protected:
358 static TypeObject _type;
360 static void classDescInserter(TypeObject &oType);
361 static const Char8 *getClassname (void );
363 /*---------------------------------------------------------------------*/
364 /*! \name Fields */
365 /*! \{ */
367 SFUnrecNodePtr _sfTarget;
368 SFBool _sfEnablePivot;
369 SFUnrecNodePtr _sfActiveSubHandle;
370 SFPnt2f _sfLastMousePos;
371 SFUnrecViewportPtr _sfViewport;
372 SFBool _sfActive;
373 SFVec3f _sfLength;
374 SFPnt3f _sfPivot;
375 SFUnrecNodePtr _sfHandleXNode;
376 SFUnrecNodePtr _sfHandleYNode;
377 SFUnrecNodePtr _sfHandleZNode;
378 SFUnrecNodePtr _sfHandlePNode;
379 SFUnrecNodePtr _sfTransXNode;
380 SFUnrecNodePtr _sfTransYNode;
381 SFUnrecNodePtr _sfTransZNode;
382 SFUnrecNodePtr _sfPivotNode;
383 SFUnrecMaterialPtr _sfMaterialX;
384 SFUnrecMaterialPtr _sfMaterialY;
385 SFUnrecMaterialPtr _sfMaterialZ;
386 SFUnrecMaterialPtr _sfMaterialPivot;
387 SFUnrecNodePtr _sfAxisLinesN;
389 /*! \} */
390 /*---------------------------------------------------------------------*/
391 /*! \name Constructors */
392 /*! \{ */
394 ManipulatorBase(void);
395 ManipulatorBase(const ManipulatorBase &source);
397 /*! \} */
398 /*---------------------------------------------------------------------*/
399 /*! \name Destructors */
400 /*! \{ */
402 virtual ~ManipulatorBase(void);
404 /*! \} */
405 /*---------------------------------------------------------------------*/
406 /*! \name onCreate */
407 /*! \{ */
409 void onCreate(const Manipulator *source = NULL);
411 /*! \} */
412 /*---------------------------------------------------------------------*/
413 /*! \name Generic Field Access */
414 /*! \{ */
416 GetFieldHandlePtr getHandleTarget (void) const;
417 EditFieldHandlePtr editHandleTarget (void);
418 GetFieldHandlePtr getHandleEnablePivot (void) const;
419 EditFieldHandlePtr editHandleEnablePivot (void);
420 GetFieldHandlePtr getHandleActiveSubHandle (void) const;
421 EditFieldHandlePtr editHandleActiveSubHandle(void);
422 GetFieldHandlePtr getHandleLastMousePos (void) const;
423 EditFieldHandlePtr editHandleLastMousePos (void);
424 GetFieldHandlePtr getHandleViewport (void) const;
425 EditFieldHandlePtr editHandleViewport (void);
426 GetFieldHandlePtr getHandleActive (void) const;
427 EditFieldHandlePtr editHandleActive (void);
428 GetFieldHandlePtr getHandleLength (void) const;
429 EditFieldHandlePtr editHandleLength (void);
430 GetFieldHandlePtr getHandlePivot (void) const;
431 EditFieldHandlePtr editHandlePivot (void);
432 GetFieldHandlePtr getHandleHandleXNode (void) const;
433 EditFieldHandlePtr editHandleHandleXNode (void);
434 GetFieldHandlePtr getHandleHandleYNode (void) const;
435 EditFieldHandlePtr editHandleHandleYNode (void);
436 GetFieldHandlePtr getHandleHandleZNode (void) const;
437 EditFieldHandlePtr editHandleHandleZNode (void);
438 GetFieldHandlePtr getHandleHandlePNode (void) const;
439 EditFieldHandlePtr editHandleHandlePNode (void);
440 GetFieldHandlePtr getHandleTransXNode (void) const;
441 EditFieldHandlePtr editHandleTransXNode (void);
442 GetFieldHandlePtr getHandleTransYNode (void) const;
443 EditFieldHandlePtr editHandleTransYNode (void);
444 GetFieldHandlePtr getHandleTransZNode (void) const;
445 EditFieldHandlePtr editHandleTransZNode (void);
446 GetFieldHandlePtr getHandlePivotNode (void) const;
447 EditFieldHandlePtr editHandlePivotNode (void);
448 GetFieldHandlePtr getHandleMaterialX (void) const;
449 EditFieldHandlePtr editHandleMaterialX (void);
450 GetFieldHandlePtr getHandleMaterialY (void) const;
451 EditFieldHandlePtr editHandleMaterialY (void);
452 GetFieldHandlePtr getHandleMaterialZ (void) const;
453 EditFieldHandlePtr editHandleMaterialZ (void);
454 GetFieldHandlePtr getHandleMaterialPivot (void) const;
455 EditFieldHandlePtr editHandleMaterialPivot (void);
456 GetFieldHandlePtr getHandleAxisLinesN (void) const;
457 EditFieldHandlePtr editHandleAxisLinesN (void);
459 /*! \} */
460 /*---------------------------------------------------------------------*/
461 /*! \name Field Get */
462 /*! \{ */
465 SFPnt2f *editSFLastMousePos (void);
466 const SFPnt2f *getSFLastMousePos (void) const;
469 Pnt2f &editLastMousePos (void);
470 const Pnt2f &getLastMousePos (void) const;
472 /*! \} */
473 /*---------------------------------------------------------------------*/
474 /*! \name Field Set */
475 /*! \{ */
477 void setLastMousePos (const Pnt2f &value);
479 /*! \} */
480 /*---------------------------------------------------------------------*/
481 /*! \name Ptr MField Set */
482 /*! \{ */
484 /*! \} */
485 /*---------------------------------------------------------------------*/
486 /*! \name Sync */
487 /*! \{ */
489 #ifdef OSG_MT_CPTR_ASPECT
490 virtual void execSyncV( FieldContainer &oFrom,
491 ConstFieldMaskArg whichField,
492 AspectOffsetStore &oOffsets,
493 ConstFieldMaskArg syncMode ,
494 const UInt32 uiSyncInfo);
496 void execSync ( ManipulatorBase *pFrom,
497 ConstFieldMaskArg whichField,
498 AspectOffsetStore &oOffsets,
499 ConstFieldMaskArg syncMode ,
500 const UInt32 uiSyncInfo);
501 #endif
503 /*! \} */
504 /*---------------------------------------------------------------------*/
505 /*! \name Edit */
506 /*! \{ */
508 /*! \} */
509 /*---------------------------------------------------------------------*/
510 /*! \name Aspect Create */
511 /*! \{ */
513 /*! \} */
514 /*---------------------------------------------------------------------*/
515 /*! \name Edit */
516 /*! \{ */
517 /*! \} */
518 /*---------------------------------------------------------------------*/
519 /*! \name Sync */
520 /*! \{ */
522 virtual void resolveLinks(void);
524 /*! \} */
525 /*========================== PRIVATE ================================*/
527 private:
528 /*---------------------------------------------------------------------*/
530 // prohibit default functions (move to 'public' if you need one)
531 void operator =(const ManipulatorBase &source);
534 typedef ManipulatorBase *ManipulatorBaseP;
536 OSG_END_NAMESPACE
538 #endif /* _OSGMANIPULATORBASE_H_ */