r3impexp

r33ds
r3boujou
r3dxf
r3ica
r3jsio
r3v3io

r3impexp

Class

real/code/r3impexp.h

Library

r3code

Description:

Base class for import/export classes. NOTE: this file shouldn't be in this library.

See Also

oops/r3root.h

Super Class

r3Root

R3CLID_ROOT

JavaScript

r3Importexport

Class Identifier

R3CLID_IMPORTEXPORT - 109

Methods

WRITEOBJECTS, READOBJECTS, WRITEOBJECTSBEGINLEVEL, WRITEOBJECTSENDLEVEL, READMACROS, BEGINREAD, ENDREAD, BEGINWRITE, ENDWRITE, READOPTIONS, WRITEGRIDS, GETFILEEXTENSION,

Attributes

FileName, PrimLayer, MaterialLayer, Mode, File, Model, CurrentLayer, SubLayer,

Registration

int R3RegisterImportExportClass(R3APP *app);

R3IEM_WRITEOBJECTS

Method

WRITEOBJECTS

Identifier

R3IEM_WRITEOBJECTS

Return

R3BOOL, FALSE cancels

Param 3:

R3OBJ*, geometric object to be saved

JavaScript

rc = obj.WRITEOBJECTS(p3);

Description

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

Method

READOBJECTS

Identifier

R3IEM_READOBJECTS

Return

R3BOOL, FALSE means error

Param 3:

R3BOOL, replace. If true, clear the contents of the layer before reading objects.

JavaScript

rc = obj.READOBJECTS(p3);

Description

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

Method

WRITEOBJECTSBEGINLEVEL

Identifier

R3IEM_WRITEOBJECTSBEGINLEVEL

Param 3:

R3OBJ*, level object

JavaScript

obj.WRITEOBJECTSBEGINLEVEL(p3);

Description

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

Method

WRITEOBJECTSENDLEVEL

Identifier

R3IEM_WRITEOBJECTSENDLEVEL

Param 3:

R3OBJ*, level object

JavaScript

obj.WRITEOBJECTSENDLEVEL(p3);

Description

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

Method

READMACROS

Identifier

R3IEM_READMACROS

JavaScript

obj.READMACROS();

Description

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

Method

BEGINREAD

Identifier

R3IEM_BEGINREAD

JavaScript

obj.BEGINREAD();

Description

Start reading. It is up to the sub class to implement this method.

R3IEM_ENDREAD

Method

ENDREAD

Identifier

R3IEM_ENDREAD

JavaScript

obj.ENDREAD();

Description

End reading. It is up to the sub class to implement this method.

R3IEM_BEGINWRITE

Method

BEGINWRITE

Identifier

R3IEM_BEGINWRITE

JavaScript

obj.BEGINWRITE();

Description

Start writing session. It is up to sub classes to implement these.

R3IEM_ENDWRITE

Method

ENDWRITE

Identifier

R3IEM_ENDWRITE

JavaScript

obj.ENDWRITE();

Description

End writing session. It is up to sub classes to implement these.

R3IEM_READOPTIONS

Method

READOPTIONS

Identifier

R3IEM_READOPTIONS

Param 3:

R3OBJ*, format specific model to be initialized.

JavaScript

obj.READOPTIONS(p3);

Description

Read format specific options from the opened file and intialize format specific model.

R3IEM_WRITEGRIDS

Method

WRITEGRIDS

Identifier

R3IEM_WRITEGRIDS

JavaScript

obj.WRITEGRIDS();

Description

See R3IEM_READOBJECTS, R3IEM_WRITEOBJECTS

R3IECM_GETFILEEXTENSION

Method

GETFILEEXTENSION

Identifier

R3IECM_GETFILEEXTENSION

Return

char*, extension

JavaScript

rc = obj.GETFILEEXTENSION();

Description

Class method. Returns the file extension (.r3d, .dxf etc.) * If the file format doesn't define any extension, NULL is returned.

FileName

Attribute

FileName

Identifier

R3IEA_FileName

JavaScript type

String

C type

char*

Description

name of the file

Syntax


jsobj.SetFileName(value);


char* value = ...;
R3SetAttrs(r3obj, R3IEA_FileName, value, R3TAG_END);

PrimLayer

Attribute

PrimLayer

Identifier

R3IEA_PrimLayer

JavaScript type

Object

C type

R3OBJ*

Description

geometric objects

Syntax


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

Attribute

MaterialLayer

Identifier

R3IEA_MaterialLayer

JavaScript type

Object

C type

R3OBJ*

Description

materials

Syntax


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

Attribute

Mode

Identifier

R3IEA_Mode

JavaScript type

Integer

C type

R3INT

Description

see open modes below

Syntax


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

Attribute

File

Identifier

R3IEA_File

JavaScript type

Object

C type

R3OBJ*

Description

file object

Syntax


value = jsobj.GetFile();


R3OBJ* value;
R3GetAttrs(r3obj, R3IEA_File, &value, R3TAG_END);

Model

Attribute

Model

Identifier

R3IEA_Model

JavaScript type

Object

C type

R3OBJ*

Description

file format specific options

Syntax


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

Attribute

CurrentLayer

Identifier

R3IEA_CurrentLayer

JavaScript type

Object

C type

R3OBJ*

Description

current project

Syntax


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

Attribute

SubLayer

Identifier

R3IEA_SubLayer

JavaScript type

Object

C type

R3OBJ*

Description

layer to be exported

Syntax


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

R3IEMODE_WRITE
R3IEMODE_READ

for backward compatibility

Tags

Tags

R3IEA_Binary
R3IEA_ProgressIndicator
R3IEA_OpenClose