r3impexp
real/code/r3impexp.h
r3code
Base class for import/export classes. NOTE: this file shouldn't be in this library.
r3Root
R3CLID_ROOT
r3Importexport
R3CLID_IMPORTEXPORT - 109
WRITEOBJECTS, READOBJECTS, WRITEOBJECTSBEGINLEVEL, WRITEOBJECTSENDLEVEL, READMACROS, BEGINREAD, ENDREAD, BEGINWRITE, ENDWRITE, READOPTIONS, WRITEGRIDS, GETFILEEXTENSION,
FileName, PrimLayer, MaterialLayer, Mode, File, Model, CurrentLayer, SubLayer,
int R3RegisterImportExportClass(R3APP *app);
R3IEM_WRITEOBJECTS
WRITEOBJECTS
R3IEM_WRITEOBJECTS
R3BOOL, FALSE cancels
R3OBJ*, geometric object to be saved
rc = obj.WRITEOBJECTS(p3);
Save given geometric object to a file. This method is defined by the impexp base class but it is up to sub classes to implement this.
R3IEM_READOBJECTS
READOBJECTS
R3IEM_READOBJECTS
R3BOOL, FALSE means error
R3BOOL, replace. If true, clear the contents of the layer before reading objects.
rc = obj.READOBJECTS(p3);
Read geometric objects from file. It is up to sub classes to implement this method. Version 1: If replace is given, and the file to be read contains data, it is the responsibility of the object to clear the buffer.
R3IEM_WRITEOBJECTSBEGINLEVEL
WRITEOBJECTSBEGINLEVEL
R3IEM_WRITEOBJECTSBEGINLEVEL
R3OBJ*, level object
obj.WRITEOBJECTSBEGINLEVEL(p3);
Used for defining hierarchical structure of the object tree. Begin level is sent for each level object to indicate that new hierarchy level is entered. It is up to the sub class to implement this methods
R3IEM_WRITEOBJECTSENDLEVEL
WRITEOBJECTSENDLEVEL
R3IEM_WRITEOBJECTSENDLEVEL
R3OBJ*, level object
obj.WRITEOBJECTSENDLEVEL(p3);
Used for defining hierarchical structure of the object tree. Sent after all sub objects in the level in question are written. It is up to the sub class to implement this methods
R3IEM_READMACROS
READMACROS
R3IEM_READMACROS
obj.READMACROS();
These two methods are used for reading/writing macros. It is up to the sub class to implement these. The macro object can be found using R3AppMacros(app) function. Use R3MCM_ENUMMACROS and R3MCM_ENUMBINDINGS methods to scan through and export macros.
R3IEM_BEGINREAD
BEGINREAD
R3IEM_BEGINREAD
obj.BEGINREAD();
Start reading. It is up to the sub class to implement this method.
R3IEM_ENDREAD
ENDREAD
R3IEM_ENDREAD
obj.ENDREAD();
End reading. It is up to the sub class to implement this method.
R3IEM_BEGINWRITE
BEGINWRITE
R3IEM_BEGINWRITE
obj.BEGINWRITE();
Start writing session. It is up to sub classes to implement these.
R3IEM_ENDWRITE
ENDWRITE
R3IEM_ENDWRITE
obj.ENDWRITE();
End writing session. It is up to sub classes to implement these.
R3IEM_READOPTIONS
READOPTIONS
R3IEM_READOPTIONS
R3OBJ*, format specific model to be initialized.
obj.READOPTIONS(p3);
Read format specific options from the opened file and intialize format specific model.
R3IEM_WRITEGRIDS
WRITEGRIDS
R3IEM_WRITEGRIDS
obj.WRITEGRIDS();
See R3IEM_READOBJECTS, R3IEM_WRITEOBJECTS
R3IECM_GETFILEEXTENSION
GETFILEEXTENSION
R3IECM_GETFILEEXTENSION
char*, extension
rc = obj.GETFILEEXTENSION();
Class method. Returns the file extension (.r3d, .dxf etc.) * If the file format doesn't define any extension, NULL is returned.
FileName
FileName
R3IEA_FileName
String
char*
name of the file
jsobj.SetFileName(value);
char* value = ...;
R3SetAttrs(r3obj, R3IEA_FileName, value, R3TAG_END);
PrimLayer
PrimLayer
R3IEA_PrimLayer
Object
R3OBJ*
geometric objects
jsobj.SetPrimLayer(value);
value = jsobj.GetPrimLayer();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3IEA_PrimLayer, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_PrimLayer, &value, R3TAG_END);
MaterialLayer
MaterialLayer
R3IEA_MaterialLayer
Object
R3OBJ*
materials
jsobj.SetMaterialLayer(value);
value = jsobj.GetMaterialLayer();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3IEA_MaterialLayer, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_MaterialLayer, &value, R3TAG_END);
Mode
Mode
R3IEA_Mode
Integer
R3INT
see open modes below
jsobj.SetMode(value);
value = jsobj.GetMode();
R3INT value = ...;
R3SetAttrs(r3obj, R3IEA_Mode, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3IEA_Mode, &value, R3TAG_END);
File
File
R3IEA_File
Object
R3OBJ*
file object
value = jsobj.GetFile();
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_File, &value, R3TAG_END);
Model
Model
R3IEA_Model
Object
R3OBJ*
file format specific options
jsobj.SetModel(value);
value = jsobj.GetModel();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3IEA_Model, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_Model, &value, R3TAG_END);
CurrentLayer
CurrentLayer
R3IEA_CurrentLayer
Object
R3OBJ*
current project
jsobj.SetCurrentLayer(value);
value = jsobj.GetCurrentLayer();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3IEA_CurrentLayer, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_CurrentLayer, &value, R3TAG_END);
SubLayer
SubLayer
R3IEA_SubLayer
Object
R3OBJ*
layer to be exported
jsobj.SetSubLayer(value);
value = jsobj.GetSubLayer();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3IEA_SubLayer, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_SubLayer, &value, R3TAG_END);
open mode
for backward compatibility