RobWorkProject
23.9.11-
|
a class for representing a geometry that is scaled and transformed, and which is attached to a frame. More...
#include <Geometry.hpp>
Public Types | |
enum | GeometryGroupMask { PhysicalGroup = 1 , VirtualGroup = 2 , DrawableGroup = 4 , CollisionGroup = 8 , User1Group = 1024 , User2Group = 2048 , User3Group = 4096 , User4Group = 8096 , ALL = 0xFFFFFFFF } |
A geometry may belong to a specific group of geometries. These groups are used for fast exclude filtering of geometry data in collision detection, visualization and such. There are 4 predefined groups used by RobWork. More... | |
typedef rw::core::Ptr< Geometry > | Ptr |
smart pointer type to this class | |
typedef rw::core::Ptr< const Geometry > | CPtr |
smart pointer type to this const class | |
Public Member Functions | |
Geometry (GeometryData::Ptr data, double scale=1.0) | |
constructor - autogenerated id from geometry type. More... | |
Geometry (GeometryData::Ptr data, const std::string &name, double scale=1.00) | |
constructor giving a specified id. More... | |
Geometry (GeometryData::Ptr data, const rw::math::Transform3D<> &t3d, double scale=1.0) | |
constructor - autogenerated id from geometry type. More... | |
virtual | ~Geometry () |
destructor | |
double | getScale () const |
gets the scaling factor applied when using this geometry More... | |
void | setScale (double scale) |
set the scaling factor that should be applied to this geometry when used. More... | |
void | setTransform (const rw::math::Transform3D<> &t3d) |
set transformation More... | |
const rw::math::Transform3D & | getTransform () const |
get transformation More... | |
GeometryData::Ptr | getGeometryData () |
get geometry data More... | |
const GeometryData::Ptr | getGeometryData () const |
get geometry data | |
void | setGeometryData (GeometryData::Ptr data) |
set transformation More... | |
const std::string & | getName () const |
get name of this geometry More... | |
const std::string & | getFilePath () const |
get file path of this geometry More... | |
const std::string & | getId () const |
get identifier of this geometry More... | |
void | setName (const std::string &name) |
set name of this geometry More... | |
void | setFilePath (const std::string &name) |
set file path this geometry More... | |
void | setId (const std::string &id) |
set identifier of this geometry More... | |
void | setColor (unsigned char red, unsigned char green, unsigned char blue) |
set the color of the geometry More... | |
void | setColor (float red, float green, float blue) |
set the color of the geometry More... | |
void | setFrame (rw::core::Ptr< rw::kinematics::Frame > frame) |
Set the reference frame. More... | |
rw::kinematics::Frame * | getFrame () |
Get the reference frame. More... | |
const rw::kinematics::Frame * | getFrame () const |
Get the reference frame. More... | |
void | setMask (int mask) |
Set the draw mask. More... | |
int | getMask () |
Get the draw mask. More... | |
void | getColor (float color[3]) |
get the color stored for the object More... | |
Static Public Member Functions | |
static Geometry::Ptr | makeSphere (double radi) |
util function for creating a Sphere geometry | |
static Geometry::Ptr | makeBox (double x, double y, double z) |
util function for creating a Box geometry | |
static Geometry::Ptr | makeCone (double height, double radiusTop, double radiusBot) |
util function for creating a Cone geometry | |
static Geometry::Ptr | makeCylinder (float radius, float height) |
util function for creating a Cylinder geometry | |
static Geometry::Ptr | makeGrid (int dim_x, int dim_y, double size_x=1.0, double size_y=1.0, const rw::math::Vector3D< double > &xdir=rw::math::Vector3D< double >::x(), const rw::math::Vector3D< double > &ydir=rw::math::Vector3D< double >::y()) |
Construct a grid. More... | |
a class for representing a geometry that is scaled and transformed, and which is attached to a frame.
Each geometry must have a unique ID. This is either auto generated or specified by user. The ids are used in collision detection and other algorithms where the object need an association other than its memory address.
enum GeometryGroupMask |
A geometry may belong to a specific group of geometries. These groups are used for fast exclude filtering of geometry data in collision detection, visualization and such. There are 4 predefined groups used by RobWork.
Geometry | ( | GeometryData::Ptr | data, |
double | scale = 1.0 |
||
) |
constructor - autogenerated id from geometry type.
data | |
scale |
Geometry | ( | GeometryData::Ptr | data, |
const std::string & | name, | ||
double | scale = 1.00 |
||
) |
constructor giving a specified id.
data | [in] pointer to geometry data |
name | [in] Unique name to be assigned for the geometry |
scale | [in] scaling factor |
Geometry | ( | GeometryData::Ptr | data, |
const rw::math::Transform3D<> & | t3d, | ||
double | scale = 1.0 |
||
) |
constructor - autogenerated id from geometry type.
data | [in] pointer to geometry data |
t3d | [in] transform |
scale | [in] scaling factor |
|
inline |
get the color stored for the object
color | [out] the array to store the color in |
|
inline |
get file path of this geometry
|
inline |
Get the reference frame.
|
inline |
Get the reference frame.
|
inline |
get geometry data
|
inline |
get identifier of this geometry
|
inline |
Get the draw mask.
|
inline |
get name of this geometry
|
inline |
gets the scaling factor applied when using this geometry
|
inline |
get transformation
|
static |
Construct a grid.
dim_x | [in] number of cells in first direction. |
dim_y | [in] number of cells in second direction. |
size_x | [in] size of one cell. |
size_y | [in] size of one cell. |
xdir | [in] the direction of the first dimension. |
ydir | [in] the direction of the second dimension. |
void setColor | ( | float | red, |
float | green, | ||
float | blue | ||
) |
set the color of the geometry
red | [in] the amount of red color 0-1 |
green | [in] the amount of green color 0-1 |
blue | [in] the amount of red color 0-1 |
|
inline |
set the color of the geometry
red | [in] the amount of red color 0-255 |
green | [in] the amount of green color 0-255 |
blue | [in] the amount of red color 0-255 |
|
inline |
set file path this geometry
name | [in] path to a geometry file |
|
inline |
Set the reference frame.
frame | [in] new reference frame. |
|
inline |
set transformation
data | [in] the new geometry data |
|
inline |
set identifier of this geometry
id | [in] new id |
|
inline |
Set the draw mask.
mask | [in] the draw mask. |
|
inline |
set name of this geometry
name | [in] the new name of the geometry |
|
inline |
set the scaling factor that should be applied to this geometry when used.
scale | [in] scale factor |
|
inline |
set transformation
t3d | [in] the new transform |