Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoSeparatorKit.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul Isaacs (MMM yyyy)
25** Modified by : Thad Beier (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : VSG (MMM YYYY)
48**=======================================================================*/
49
50
51#ifndef _SO_SEPARATOR_KIT_
52#define _SO_SEPARATOR_KIT_
53
54#include <Inventor/nodes/SoSeparator.h>
55#include <Inventor/nodekits/SoBaseKit.h>
56#include <Inventor/fields/SoSFEnum.h>
57#include <Inventor/sensors/SoFieldSensor.h>
58
60// Class: SoSeparatorKit
61//
62// NOTE TO DEVELOPERS:
63// For info about the structure of SoSeparatorKit:
64// [1] compile: /usr/share/src/Inventor/samples/ivNodeKitStructure
65// [2] type: ivNodeKitStructure SoSeparatorKit.
66// [3] The program prints a diagram of the scene graph and a table with
67// information about each part.
68//
69// New nodes in this subclass are:
70// callbackList, topSeparator, pickStyle, appearance,
71// transform, texture2Transform,
72// childList
73//
74// A parent node that manages a collection of child nodes
75// into a unit with the following structure:
76//
77// this
78// ------------------|
79// | "topSeparator"
80// "callbackList" |
81// ---------------------------------------------------------------
82// | | | | | |
83// "pickStyle" | "units" "transform" | |
84// "appearance" "texture2Transform" |
85// |
86// |
87// "childList"
88//
90
217class SoSeparatorKit : public SoBaseKit {
218
219 SO_KIT_HEADER(SoSeparatorKit);
220
221 // defines fields for the new parts in the catalog
222 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
223 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
224 SO_KIT_CATALOG_ENTRY_HEADER(appearance);
225 SO_KIT_CATALOG_ENTRY_HEADER(units);
226 SO_KIT_CATALOG_ENTRY_HEADER(transform);
227 SO_KIT_CATALOG_ENTRY_HEADER(texture2Transform);
228 SO_KIT_CATALOG_ENTRY_HEADER(childList);
229
230 public:
231
234 {
246 AUTO
247 };
248
249 // Fields
250#if 1 SoDEPRECATED
257#endif
276
281
282 // Overrides default method on SoNode
283 virtual SbBool affectsState() const;
284
285 private:
286 static void initClass();
287 static void exitClass();
288
289 private:
290 // Copies the contents of the given nodekit into this instance
291 virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections);
292
293 // detach/attach any sensors, callbacks, and/or field connections.
294 // Called by: start/end of SoBaseKit::readInstance
295 // and on new copy by: start/end of SoBaseKit::copy.
296 // Classes that redefine must call setUpConnections(TRUE,TRUE)
297 // at end of constructor.
298 // Returns the state of the node when this was called.
299 virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = FALSE );
300
301 // Called by the SoBaseKit::write() method. Calls setDefault(TRUE)
302 // on the topSeparator. Note that this may be overriden later by basekit
303 // if, for example, topSeparator lies on a path that is being written out.
304 virtual void setDefaultOnNonWritingFields();
305
306 // This sensor will watch the topSeparator part. If the part changes to a
307 // new node, then the fields of the old part will be disconnected and
308 // the fields of the new part will be connected.
309 // Connections are made from/to the boundingBoxCaching,
310 // renderCulling and pickCulling fields. This way, the SoSeparatorKit
311 // can be treated from the outside just like a regular SoSeparator node.
312 // Setting the fields will affect caching and culling, even though the
313 // topSeparator takes care of it.
314 // oldTopSep keeps track of the part for comparison.
315 SoFieldSensor *fieldSensor;
316 static void fieldSensorCB( void *, SoSensor *);
317 SoSeparator *oldTopSep;
318
319 void connectSeparatorFields( SoSeparator *dest, SbBool onOff );
320
321 private:
322 virtual ~SoSeparatorKit();
323
324};
325#endif /* _SO_SEPARATOR_KIT_ */
326
Base class for all node kits.
Definition SoBaseKit.h:302
Abstract base class for objects that contain fields.
Sensor class that can be attached to Open Inventor fields.
Field containing an enumerated value.
Definition SoSFEnum.h:89
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
Group node that saves and restores traversal state.
Separator nodekit class.
virtual SbBool affectsState() const
Returns TRUE if a node has an effect on the state during traversal.
SoSFEnum renderCulling
Set render culling mode.
CacheEnabled
Possible values for caching.
@ OFF
Never build or use a cache.
@ ON
Always try to build a cache.
@ AUTO
Automatic caching.
SoSFEnum boundingBoxCaching
Set bounding box caching mode.
SoSFEnum pickCulling
Set pick culling mode.
SoDEPRECATED SoSFEnum renderCaching
Set render caching mode.
SoSeparatorKit()
Constructor.
int SbBool
Boolean type.
Definition SbBase.h:87