Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoToU3DAction.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25#ifndef SO_TO_U3D_ACTION_H
26#define SO_TO_U3D_ACTION_H
27
30#include <HardCopy/SoHardCopy.h>
31
32class SoToU3DActionPrivate;
33class SoPath;
34
213{
215
216public:
217
218 /*
219 * Constructor
220 */
222
223 /*
224 * Destructor
225 */
226 virtual ~SoToU3DAction();
227
234 SoNONUNICODE virtual bool openFile( const char* filename );
235
239 virtual bool openFile( const SbString& filename );
240
241
245 virtual bool closeFile();
246
247 // Apply methods
248
252 virtual void apply( SoNode* node );
253
257 virtual void apply( SoPath* path );
258
271 virtual void apply( const SoPathList& pathList, SbBool obeysRules = false );
272
276 void forcePolygonalText3( bool force );
277
282
286 void setExportDraggers( bool force );
287
292
299 virtual void forwardTraversal(SoNode* node);
300
307 virtual void forwardTraversal(SoPath* path);
308
309private:
310 virtual void invokePreCallbacks(const SoNode* node);
311 virtual void invokePostCallbacks(const SoNode* node);
312
313private:
317 static void initClass();
318 static void exitClass();
319
320 // Internal use only.
321 const SoToU3DActionPrivate* getImpl() { return m_private; }
322
323 const SoPath* getCurPath();
324
325 SoToU3DActionPrivate* m_private;
326
327private:
329 virtual void beginTraversal( SoNode* node );
330
331private:
332
333 // static callbacks
334 static SoCallbackAction::Response separatorPreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
335 static SoCallbackAction::Response separatorPostCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
336 static SoCallbackAction::Response environmentPreCBS( void* userData, SoCallbackAction* action, const SoNode* node );
337 static SoCallbackAction::Response lightPreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
338 static SoCallbackAction::Response cameraPreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
339 static SoCallbackAction::Response backgroundPreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
340 static SoCallbackAction::Response shapePreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
341 static SoCallbackAction::Response shapePostCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
342 static SoCallbackAction::Response draggerPreCBS ( void* userData, SoCallbackAction* action, const SoNode* node );
343 static void shapeTriangleCBS( void* userData, SoCallbackAction *action,
344 const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3 );
345 static void shapeLineCBS ( void* userData, SoCallbackAction* action,
346 const SoPrimitiveVertex* v1, const SoPrimitiveVertex* v2 );
347 static void shapePointCBS ( void* userData, SoCallbackAction* action,
348 const SoPrimitiveVertex* v1 );
349
350 bool m_forcePolygonalText3, m_exportDraggers;
351
352 // Boolean to specify if we stop call of pre and post callback
353 // When we do a forwardTraversal, we should not call pre/post callback
354 bool m_stopPrePostCallback;
355};
356
357#endif // SO_TO_U3D_ACTION_H
358
359
#define SO_ACTION_HEADER(className)
Definition SoSubAction.h:69
Class for smart character strings.
Definition SbString.h:202
Performs a generic traversal of a scene graph or path.
Response
Possible responses from a pre or post callback.
Abstract base class for all database nodes.
Definition SoNode.h:145
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
Maintains a list of pointers to paths.
Definition SoPathList.h:81
Represents a vertex of a generated primitive.
<a href="IconLegend.html"><img src="extHC.gif" alt="HardCopy" border="0"></a> Export a scene graph t...
bool areDraggersExported() const
Returns true if draggers are exported.
bool isPolygonalText3Forced() const
Returns true if polygonal text3 is forced (see forcePolygonalText3).
virtual void apply(SoPath *path)
Initiates an action on the graph specified by a path.
virtual SoNONUNICODE bool openFile(const char *filename)
Set the U3D output file.
void forcePolygonalText3(bool force)
Forces SoText2 nodes to be exported using SoText3 (default is true).
void setExportDraggers(bool force)
Allow the export of draggers (default is true).
virtual void forwardTraversal(SoPath *path)
Traverse a node that is not part of the current scenegraph.
virtual bool openFile(const SbString &filename)
Set the U3D output file.
virtual void apply(SoNode *node)
Initiates an action on the graph specified by a node.
virtual void apply(const SoPathList &pathList, SbBool obeysRules=false)
Initiates an action on the graph specified by list of paths.
virtual bool closeFile()
Finalize export to the U3D output file.
virtual void forwardTraversal(SoNode *node)
Traverse a node that is not part of the current scenegraph.
virtual ~SoToU3DAction()
int SbBool
Boolean type.
Definition SbBase.h:87