VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkVRMLImporter Class Reference

imports VRML 2.0 files. More...

#include <vtkVRMLImporter.h>

Inheritance diagram for vtkVRMLImporter:
[legend]
Collaboration diagram for vtkVRMLImporter:
[legend]

Public Types

typedef vtkImporter Superclass
 
- Public Types inherited from vtkImporter
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkVRMLImporterNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
vtkObjectGetVRMLDEFObject (const char *name)
 
virtual void SetFileName (const char *)
 
virtual char * GetFileName ()
 
virtual void SetShapeResolution (int)
 
virtual int GetShapeResolution ()
 
- Public Member Functions inherited from vtkImporter
vtkImporterNewInstance () const
 
virtual vtkRendererGetRenderer ()
 
virtual void SetRenderWindow (vtkRenderWindow *)
 
virtual vtkRenderWindowGetRenderWindow ()
 
void Read ()
 
void Update ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkVRMLImporterNew ()
 
static int IsTypeOf (const char *type)
 
static vtkVRMLImporterSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkImporter
static int IsTypeOf (const char *type)
 
static vtkImporterSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkVRMLImporter ()
 
 ~vtkVRMLImporter ()
 
int OpenImportFile ()
 
virtual int ImportBegin ()
 
virtual void ImportEnd ()
 
virtual void ImportActors (vtkRenderer *)
 
virtual void ImportCameras (vtkRenderer *)
 
virtual void ImportLights (vtkRenderer *)
 
virtual void ImportProperties (vtkRenderer *)
 
FILE * GetFileFD ()
 
virtual void enterNode (const char *)
 
virtual void exitNode ()
 
virtual void enterField (const char *)
 
virtual void exitField ()
 
virtual void useNode (const char *)
 
- Protected Member Functions inherited from vtkImporter
 vtkImporter ()
 
 ~vtkImporter ()
 
virtual void ReadData ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char * FileName
 
FILE * FileFD
 
int ShapeResolution
 
- Protected Attributes inherited from vtkImporter
vtkRendererRenderer
 
vtkRenderWindowRenderWindow
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkVRMLYaccData
 

Detailed Description

imports VRML 2.0 files.

vtkVRMLImporter imports VRML 2.0 files into VTK.

Warning
These nodes are currently supported: Appearance IndexedFaceSet Box IndexedLineSet Color Material Cone Shape Coordinate Sphere Cylinder Transform DirectionalLight
As you can see this implementation focuses on getting the geometry translated. The routes and scripting nodes are ignored since they deal with directly accessing a nodes internal structure based on the VRML spec. Since this is a translation the internal data structures differ greatly from the VRML spec and the External Authoring Interface (see the VRML spec). The DEF/USE mechanism does allow the VTK user to extract objects from the scene and directly manipulate them using the native language (Tcl, Python, Java, or whatever language VTK is wrapped in). This, in a way, removes the need for the route and script mechanism (not completely though). Texture coordinates are attached to the mesh is available but image textures are not loaded. Viewpoints (camera presets) are not imported.
Thanks:
Thanks to Russ Coucher of Areva for numerous bug fixes and a new test.
See also
vtkImporter
Tests:
vtkVRMLImporter (Tests)

Definition at line 76 of file vtkVRMLImporter.h.

Member Typedef Documentation

Definition at line 81 of file vtkVRMLImporter.h.

Constructor & Destructor Documentation

vtkVRMLImporter::vtkVRMLImporter ( )
protected
vtkVRMLImporter::~vtkVRMLImporter ( )
protected

Member Function Documentation

static vtkVRMLImporter* vtkVRMLImporter::New ( )
static
static int vtkVRMLImporter::IsTypeOf ( const char *  type)
static
virtual int vtkVRMLImporter::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkImporter.

static vtkVRMLImporter* vtkVRMLImporter::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkVRMLImporter::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkImporter.

vtkVRMLImporter* vtkVRMLImporter::NewInstance ( ) const
void vtkVRMLImporter::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkImporter.

virtual void vtkVRMLImporter::SetFileName ( const char *  )
virtual

Specify the name of the file to read.

virtual char* vtkVRMLImporter::GetFileName ( )
virtual

Specify the name of the file to read.

virtual void vtkVRMLImporter::SetShapeResolution ( int  )
virtual

Specify the resolution for Sphere, Cone and Cylinder shape sources. Default is 12.

virtual int vtkVRMLImporter::GetShapeResolution ( )
virtual

Specify the resolution for Sphere, Cone and Cylinder shape sources. Default is 12.

vtkObject* vtkVRMLImporter::GetVRMLDEFObject ( const char *  name)

In the VRML spec you can DEF and USE nodes (name them), This routine will return the associated VTK object which was created as a result of the DEF mechanism Send in the name from the VRML file, get the VTK object. You will have to check and correctly cast the object since this only returns vtkObjects.

int vtkVRMLImporter::OpenImportFile ( )
protected
virtual int vtkVRMLImporter::ImportBegin ( )
protectedvirtual

Reimplemented from vtkImporter.

virtual void vtkVRMLImporter::ImportEnd ( )
protectedvirtual

Reimplemented from vtkImporter.

virtual void vtkVRMLImporter::ImportActors ( vtkRenderer )
inlineprotectedvirtual

Reimplemented from vtkImporter.

Definition at line 111 of file vtkVRMLImporter.h.

virtual void vtkVRMLImporter::ImportCameras ( vtkRenderer )
inlineprotectedvirtual

Reimplemented from vtkImporter.

Definition at line 112 of file vtkVRMLImporter.h.

virtual void vtkVRMLImporter::ImportLights ( vtkRenderer )
inlineprotectedvirtual

Reimplemented from vtkImporter.

Definition at line 113 of file vtkVRMLImporter.h.

virtual void vtkVRMLImporter::ImportProperties ( vtkRenderer )
inlineprotectedvirtual

Reimplemented from vtkImporter.

Definition at line 114 of file vtkVRMLImporter.h.

virtual void vtkVRMLImporter::enterNode ( const char *  )
protectedvirtual

Needed by the yacc/lex grammar used

virtual void vtkVRMLImporter::exitNode ( )
protectedvirtual

Needed by the yacc/lex grammar used

virtual void vtkVRMLImporter::enterField ( const char *  )
protectedvirtual

Needed by the yacc/lex grammar used

virtual void vtkVRMLImporter::exitField ( )
protectedvirtual

Needed by the yacc/lex grammar used

virtual void vtkVRMLImporter::useNode ( const char *  )
protectedvirtual

Needed by the yacc/lex grammar used

FILE* vtkVRMLImporter::GetFileFD ( )
inlineprotected

Return the file pointer to the open file.

Definition at line 126 of file vtkVRMLImporter.h.

Friends And Related Function Documentation

friend class vtkVRMLYaccData
friend

Definition at line 132 of file vtkVRMLImporter.h.

Member Data Documentation

char* vtkVRMLImporter::FileName
protected

Definition at line 128 of file vtkVRMLImporter.h.

FILE* vtkVRMLImporter::FileFD
protected

Definition at line 129 of file vtkVRMLImporter.h.

int vtkVRMLImporter::ShapeResolution
protected

Definition at line 130 of file vtkVRMLImporter.h.


The documentation for this class was generated from the following file: