Class hierarchy   Compound list   Header files   Member list  

dimeEntity Class Reference

The dimeEntity class is the superclass of all entity classes. More...

#include <Entity.h>

Inherits dimeRecordHolder.

Inherited by dimeBlock, dimeEllipse, dimeExtrusionEntity, dimeFaceEntity, dimeInsert, dimeSpline, dimeUnknownEntity and dimeVertex.

List of all members.

Public Members

Static Public Members

Protected Members


Detailed Description

The dimeEntity class is the superclass of all entity classes.


Member Function Documentation

dimeEntity::dimeEntity()

Constructor.

dimeEntity::~dimeEntity() [virtual]

Destructor.

int16 dimeEntity::getColorNumber() const

Returns the color number for this entity.

See also:
dimeEntity::setColorNumber()

void dimeEntity::setColorNumber(const int16 c)

Sets the color number for this entity. Zero indicates the BYBLOCK (floating) color. 256 indicates BYLAYER. A negative value indicates that the layer is turned off.

void dimeEntity::setLayer(const dimeLayer * const layer) [virtual]

Sets the layer for this entity. This will change the record with group code 8. If layer equals NULL, the layer will be set to the default layer.

Reimplemented in dimePolyline.

const char *dimeEntity::getEntityName() const = 0 [pure virtual]

Must be implemented by subclasses to return the entity name; e.g. POLYLINE, 3DFACE, etc.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace, dimeUnknownEntity and dimeVertex.

const dimeLayer *dimeEntity::getLayer() const

Returns the layer of this entity.

const char* dimeEntity::getLayerName() const

Convenience function which returns the layer name of this entity.

dimeEntity *dimeEntity::copy(dimeModel * const model) const = 0 [pure virtual]

Must be implemented by subclasses to return a copy of the entity. model is the model the new entity should belong to.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace, dimeUnknownEntity and dimeVertex.

bool dimeEntity::read(dimeInput * const file) [virtual]

Reads an entity from in. Can be overloaded by subclasses, but in most cases this will not be necessary.

See also:
dimeEntity::handleRecord().

Reimplemented from dimeRecordHolder.

Reimplemented in dimeBlock, dimeInsert and dimePolyline.

bool dimeEntity::write(dimeOutput * const file) [virtual]

Reimplemented from dimeRecordHolder.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace, dimeUnknownEntity and dimeVertex.

bool dimeEntity::isOfType(const int thetypeid) const [virtual]

Reimplemented from dimeRecordHolder.

Reimplemented in dimeExtrusionEntity and dimeFaceEntity.

int dimeEntity::countRecords() const [virtual]

Reimplemented from dimeRecordHolder.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeExtrusionEntity, dimeFaceEntity, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace, dimeUnknownEntity and dimeVertex.

void dimeEntity::print() const [virtual]

Reimplemented in dime3DFace, dimeArc, dimeCircle, dimeEllipse, dimeLWPolyline, dimeLine and dimeSpline.

bool dimeEntity::isDeleted() const

Returns if this entity is marked as deleted or not.

See also:
dimeEntity::setDeleted().

void dimeEntity::setDeleted(const bool onOff)

Sets the deleted state of this entity to onOff.

See also:
dimeEntity::isDeleted().

bool dimeEntity::getRecord(const int groupcode, dimeParam &param, const int index) const [virtual]

Reimplemented from dimeRecordHolder.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeExtrusionEntity, dimeFaceEntity, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace and dimeVertex.

dimeEntity::GeometryType dimeEntity::extractGeometry(dimeArray <dimeVec3f> &verts, dimeArray <int> &indices, dimeVec3f &extrusionDir, float &thickness) [virtual]

A special convenience function, included for your pleasure. Enables the user to ignore the type of entity, and just call this method when extracting geometry. Very useful for 3D viewers that need DXF support. Check out the dxf2vrml directory for an example on how to convert a DXF file to VRML.

Should be overloaded by all subclasses that have geometry, default function returns no geometry. Don't forget to transform vertices by the current transformation matrix if used in a callback from dimeEntity::traverse().

If there are coordinates, but no indices, this means running indices for the entire vertex array.

Different faces and/or line segments are separated by a -1 in the indices array, just as in VRML files.

If thickness != 0.0, the data should, before transformation, be extruded by that length along the extrusion direction. Hence, a point becomes a line, a line becomes a quad, and a polygon becomes an object with a volume.

If thickness == 0.0 and extrusionDir != (0,0,1) all the vertices should be transformed by a matrix that can be created using dimeEntity::generateUCS(). If you are using dimeModel::traverseEntities() to extract the geometry, simply right-multiply the UCS matrix with the matrix found in dimeState to get the correct transformation.

Reimplemented in dimeArc, dimeCircle, dimeFaceEntity, dimeLWPolyline, dimeLine, dimePoint and dimePolyline.

dimeEntity* dimeEntity::createEntity(const char * const name, dimeMemHandler * const memhandler) [static]

Static function which creates an entity based on its name.

bool dimeEntity::readEntities(dimeInput * const file, dimeArray <dimeEntity*> &array, const char * const stopat) [static]

Static function that reads all entities until an entity of type stopat is found. Returns true if all entities were read OK. When reading stops, the group code 0 and the entity name (stopat) will already have been read.

bool dimeEntity::copyEntityArray(const dimeEntity *const*const array, const int nument, dimeModel * const model, dimeArray <dimeEntity*> &destarray) [static]

Static function which copies all non-deleted entites from array of length nument into destarray.

dimeEntity** dimeEntity::copyEntityArray(const dimeEntity *const*const array, int &nument, dimeModel * const model) [static]

Static function which copies all non-deleted entites from array of length nument into a new array. Will return the number of copied entities in nument. This function returns NULL either when out of memory, or if there was no non-deleted entities.

void dimeEntity::arbitraryAxis(const dimeVec3f &givenaxis, dimeVec3f &newaxis) [static]

Will return an "arbitrary" axis, based on givenaxis. Based on code from DXF Parser R10, from Autodesk Inc. Is used to find the x-axis bases on the given z-axis.

See also:
dimeEntity::generateUCS()

void dimeEntity::generateUCS(const dimeVec3f &givenaxis, dimeMatrix &m) [static]

Will generate a coordinate system, based on givenaxis, which will be the z-axis in the new coordinate system.

See also:
dimeEntity::arbitraryAxis()

bool dimeEntity::preWrite(dimeOutput * const file) [protected]

Writes the group code 0, layer name, and some other stuff.

bool dimeEntity::traverse(const dimeState * const state, dimeCallback callback, void *userdata) [protected, virtual]

The traversal function used when dimeModel::traverseEntities() is called. Most entities use this default method, but some entities (INSERT, BUILD) will need to overload it.

Reimplemented in dimeBlock, dimeInsert and dimePolyline.

void dimeEntity::fixReferences(dimeModel * const) [protected, virtual]

Used to find all forward references.

See also:
dimeEntitiesSection::fixReferences().

Reimplemented in dimeBlock and dimeInsert.

bool dimeEntity::handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler * const) [protected, virtual]

Reimplemented from dimeRecordHolder.

Reimplemented in dime3DFace, dimeArc, dimeBlock, dimeCircle, dimeEllipse, dimeExtrusionEntity, dimeFaceEntity, dimeInsert, dimeLWPolyline, dimeLine, dimePoint, dimePolyline, dimeSolid, dimeSpline, dimeTrace and dimeVertex.

bool dimeEntity::copyRecords(dimeEntity * const entity, dimeModel * const model) const [protected]

Copies the common and unclassified records.


The documentation for this class was generated from the following files:
Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.