MyDXFFile solid class. More...
#include <dxf_solid.hpp>

Public Member Functions | |
DXFSolid (MyDXFFile *dxffile, const std::string &layername) | |
Constructor for making a solid from a DXF-file layer. More... | |
DXFSolid (MyDXFFile *dxffile, MyDXFEntities *ent) | |
Constructor for making a solid from entities in a MyDXFEntities object ent. More... | |
DXFSolid (std::istream &is) | |
Constructor for loading solid data from stream is. More... | |
virtual | ~DXFSolid () |
Destructor. More... | |
virtual bool | inside (const Vec3D &x) const |
Return if 3D point x in simulation space is inside solid. More... | |
void | debug_print (std::ostream &os) const |
Print debugging information to stream os. More... | |
void | define_2x3_mapping (Vec3D(*func)(const Vec3D &)) |
Define mapping from 3D space to 2D space. More... | |
virtual void | save (std::ostream &os) const |
Saves solid data to stream os. More... | |
![]() | |
virtual | ~Solid () |
Virtual destructor. More... | |
void | reset_transformation (void) |
Set transformation to unity. More... | |
void | set_transformation (const Transformation &T) |
Set transformation. More... | |
void | translate (const Vec3D &dx) |
Translate solid. More... | |
void | scale (double sx) |
Scale solid. More... | |
void | scale (const Vec3D &sx) |
Scale solid. More... | |
void | rotate_x (double a) |
Rotate solid around x-axis. More... | |
void | rotate_y (double a) |
Rotate solid around y-axis. More... | |
void | rotate_z (double a) |
Rotate solid around z-axis. More... | |
Static Public Member Functions | |
static Vec3D | unity (const Vec3D &x) |
Unity transformation. More... | |
static Vec3D | rotx (const Vec3D &x) |
Solid of revolution around x-axis. More... | |
static Vec3D | roty (const Vec3D &x) |
Solid of revolution around y-axis. More... | |
static Vec3D | rotz (const Vec3D &x) |
Solid of revolution around z-axis. More... | |
Additional Inherited Members | |
![]() | |
Solid () | |
Constructor. More... | |
![]() | |
Transformation | _T |
Detailed Description
MyDXFFile solid class.
DXFSolid is an implementation of Solid using MyDXFFile entities. The solid is built from a two dimensional area defined by enclosing the area with dxf path objects in one layer. The solid volume in (three dimensional) simulation space is defined using a combination of two transformations. The first transformation is from simulation space to intermediate 3D space and it is made using the Transformation class. These intermediate 3D space points are then mapped to two dimensional dxf space using an optional user defined function. The Transformation defaults to unity matrix and if the user defined function is left undefined it defaults to .
Constructor & Destructor Documentation
◆ DXFSolid() [1/3]
DXFSolid::DXFSolid | ( | MyDXFFile * | dxffile, |
const std::string & | layername | ||
) |
Constructor for making a solid from a DXF-file layer.
The entities from the DXF-file layer layername are copied to DXFSolid object. No dependency stays between dxffile and the object constructed. The transformations are initialized to unity.
◆ DXFSolid() [2/3]
DXFSolid::DXFSolid | ( | MyDXFFile * | dxffile, |
MyDXFEntities * | ent | ||
) |
Constructor for making a solid from entities in a MyDXFEntities object ent.
Entities from ent are copied to DXFSolid object. The entities are from dxffile. An internal copy of the entities object is made. The transformations are initialized to unity.
◆ DXFSolid() [3/3]
DXFSolid::DXFSolid | ( | std::istream & | is | ) |
Constructor for loading solid data from stream is.
◆ ~DXFSolid()
|
virtual |
Destructor.
Member Function Documentation
◆ debug_print()
|
virtual |
Print debugging information to stream os.
Implements Solid.
◆ define_2x3_mapping()
Define mapping from 3D space to 2D space.
The mapping function can be user defined or one of the predefined functions: unity(), rotx(), roty() or rotz(). The mapping function can return a vector with NaN components for guaranteed inside solid result. Similarly infinity is guaranteed to give free space result.
◆ inside()
|
virtual |
Return if 3D point x in simulation space is inside solid.
Implements Solid.
◆ rotx()
◆ roty()
◆ rotz()
◆ save()
|
virtual |
Saves solid data to stream os.
Implements Solid.
◆ unity()
The documentation for this class was generated from the following files: