OpenWalnut
1.4.0
|
Dataset to store a bunch of points without order or topology. More...
#include <WDataSetPoints.h>
Public Types | |
enum | ColorType { GRAY = 1, RGB = 3, RGBA =4 } |
The type of colors we have for each point. More... | |
typedef boost::shared_ptr < WDataSetPoints > | SPtr |
Pointer to dataset. More... | |
typedef boost::shared_ptr < const WDataSetPoints > | ConstSPtr |
Pointer to const dataset. More... | |
typedef boost::shared_ptr < std::vector< float > > | VertexArray |
List of vertex coordinates in term of components of vertices. More... | |
typedef boost::shared_ptr < std::vector< float > > | ColorArray |
Colors for each vertex in VertexArray. More... | |
![]() | |
typedef boost::shared_ptr < WDataSet > | SPtr |
Shared pointer abbreviation to a instance of this class. More... | |
typedef boost::shared_ptr < const WDataSet > | ConstSPtr |
Shared pointer abbreviation to a const instance of this class. More... | |
Public Member Functions | |
WDataSetPoints (VertexArray vertices, ColorArray colors, WBoundingBox boundingBox) | |
Constructs a new set of points. More... | |
WDataSetPoints (VertexArray vertices, ColorArray colors) | |
Constructs a new set of points. More... | |
WDataSetPoints () | |
Constructs a new set of points. More... | |
virtual | ~WDataSetPoints () |
Destructor. More... | |
size_t | size () const |
Get number of points in this data set. More... | |
virtual bool | isTexture () const |
Determines whether this dataset can be used as a texture. More... | |
virtual const std::string | getName () const |
Gets the name of this prototype. More... | |
virtual const std::string | getDescription () const |
Gets the description for this prototype. More... | |
VertexArray | getVertices () const |
Getter for the point vertices. More... | |
ColorArray | getColors () const |
Getter for the point colors. More... | |
WBoundingBox | getBoundingBox () const |
Get the bounding box. More... | |
WPosition | operator[] (const size_t pointIdx) const |
Query coordinates of a given point. More... | |
WPosition | getPosition (const size_t pointIdx) const |
Query coordinates of a given point. More... | |
WColor | getColor (const size_t pointIdx) const |
The color of a given point. More... | |
bool | isValidPointIdx (const size_t pointIdx) const |
Is this a valid point index? More... | |
ColorType | getColorType () const |
Check the type of color. More... | |
![]() | |
WDataSet () | |
This constructor should be used if a dataSet does not stem from a file. More... | |
virtual | ~WDataSet () |
Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. More... | |
void | setFilename (const std::string filename) |
Set the name of the file that this data set stems from. More... | |
std::string | getFilename () const |
Get the name of the file that this data set stems from. More... | |
OW_API_DEPRECATED void | setFileName (const std::string filename) |
Set the name of the file that this data set stems from. More... | |
OW_API_DEPRECATED std::string | getFileName () const |
Get the name of the file that this data set stems from. More... | |
virtual boost::shared_ptr < WDataSetVector > | isVectorDataSet () |
Checks if this dataset is a vector dataset. More... | |
virtual osg::ref_ptr < WDataTexture3D > | getTexture () const |
Returns the texture- representation of the dataset. More... | |
boost::shared_ptr< WProperties > | getProperties () const |
Return a pointer to the properties object of the dataset. More... | |
boost::shared_ptr< WProperties > | getInformationProperties () const |
Return a pointer to the information properties object of the dataset. More... | |
![]() | |
WTransferable () | |
Default constructor. More... | |
virtual | ~WTransferable () |
Destructor. More... | |
![]() | |
WPrototyped () | |
Default constructor. More... | |
virtual | ~WPrototyped () |
Destructor. More... | |
template<typename T > | |
bool | isA () |
Checks whether the actual prototype has the specified runtime type. More... | |
Static Public Member Functions | |
static boost::shared_ptr < WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
![]() | |
static boost::shared_ptr < WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
Static Protected Attributes | |
static boost::shared_ptr < WPrototyped > | m_prototype = boost::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
![]() | |
static boost::shared_ptr < WPrototyped > | m_prototype = boost::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
Private Member Functions | |
void | init (bool calcBB=false) |
Initialize arrays and bbox if needed. More... | |
Private Attributes | |
VertexArray | m_vertices |
Point vector for all points. More... | |
ColorArray | m_colors |
An array of the colors per vertex. More... | |
ColorType | m_colorType |
Which colortype do we use in m_colors. More... | |
WBoundingBox | m_bb |
Axis aligned bounding box for all point-vertices of this dataset. More... | |
Additional Inherited Members | |
![]() | |
boost::shared_ptr< WProperties > | m_properties |
The property object for the dataset. More... | |
boost::shared_ptr< WProperties > | m_infoProperties |
The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More... | |
Dataset to store a bunch of points without order or topology.
Definition at line 40 of file WDataSetPoints.h.
typedef boost::shared_ptr< std::vector< float > > WDataSetPoints::ColorArray |
Colors for each vertex in VertexArray.
Definition at line 62 of file WDataSetPoints.h.
typedef boost::shared_ptr< const WDataSetPoints > WDataSetPoints::ConstSPtr |
Pointer to const dataset.
Definition at line 52 of file WDataSetPoints.h.
typedef boost::shared_ptr< WDataSetPoints > WDataSetPoints::SPtr |
Pointer to dataset.
Definition at line 47 of file WDataSetPoints.h.
typedef boost::shared_ptr< std::vector< float > > WDataSetPoints::VertexArray |
List of vertex coordinates in term of components of vertices.
Definition at line 57 of file WDataSetPoints.h.
The type of colors we have for each point.
Definition at line 194 of file WDataSetPoints.h.
WDataSetPoints::WDataSetPoints | ( | WDataSetPoints::VertexArray | vertices, |
WDataSetPoints::ColorArray | colors, | ||
WBoundingBox | boundingBox | ||
) |
Constructs a new set of points.
If no color is specified, white is used for all points.
vertices | the vertices of the points, stored in x1,y1,z1,x2,y2,z2, ..., xn,yn,zn scheme |
colors | the colors of each vertex. Can be NULL.. Stored as R1,G1,B1,A1, ... Rn,Gn,Bn,An |
boundingBox | The bounding box of the points (first minimum, second maximum). |
Definition at line 38 of file WDataSetPoints.cpp.
References init().
WDataSetPoints::WDataSetPoints | ( | WDataSetPoints::VertexArray | vertices, |
WDataSetPoints::ColorArray | colors | ||
) |
Constructs a new set of points.
The bounding box is calculated during construction. If no color is specified, white is used for all points.
vertices | the vertices of the points, stored in x1,y1,z1,x2,y2,z2, ..., xn,yn,zn scheme |
colors | the colors of each vertex. Can be NULL.. Stored as R1,[G1,B1,[A1,]] ... Rn,[Gn,Bn,[An]] |
Definition at line 58 of file WDataSetPoints.cpp.
References init().
WDataSetPoints::WDataSetPoints | ( | ) |
Constructs a new set of points.
The constructed instance is empty..
Definition at line 76 of file WDataSetPoints.cpp.
Referenced by getPrototype().
|
virtual |
Destructor.
Definition at line 81 of file WDataSetPoints.cpp.
WBoundingBox WDataSetPoints::getBoundingBox | ( | ) | const |
Get the bounding box.
Definition at line 163 of file WDataSetPoints.cpp.
References m_bb.
WColor WDataSetPoints::getColor | ( | const size_t | pointIdx | ) | const |
The color of a given point.
WOutOfBounds | if invalid index is used. |
pointIdx | the point index. |
Definition at line 185 of file WDataSetPoints.cpp.
References getColorType(), isValidPointIdx(), and m_colors.
WDataSetPoints::ColorArray WDataSetPoints::getColors | ( | ) | const |
Getter for the point colors.
Definition at line 158 of file WDataSetPoints.cpp.
References m_colors.
WDataSetPoints::ColorType WDataSetPoints::getColorType | ( | ) | const |
Check the type of color.
Definition at line 219 of file WDataSetPoints.cpp.
References m_colorType.
Referenced by getColor().
|
virtual |
Gets the description for this prototype.
Reimplemented from WDataSet.
Definition at line 138 of file WDataSetPoints.cpp.
|
virtual |
Gets the name of this prototype.
Reimplemented from WDataSet.
Definition at line 133 of file WDataSetPoints.cpp.
Query coordinates of a given point.
WOutOfBounds | if invalid index is used. |
pointIdx | the point index. |
Definition at line 180 of file WDataSetPoints.cpp.
References operator[]().
|
static |
Returns a prototype instantiated with the true type of the deriving class.
Definition at line 143 of file WDataSetPoints.cpp.
References m_prototype, and WDataSetPoints().
WDataSetPoints::VertexArray WDataSetPoints::getVertices | ( | ) | const |
Getter for the point vertices.
Definition at line 153 of file WDataSetPoints.cpp.
References m_vertices.
|
private |
Initialize arrays and bbox if needed.
Used during construction.
calcBB | if true, the bounding box is calculated |
Definition at line 86 of file WDataSetPoints.cpp.
References m_bb, m_colors, m_colorType, and m_vertices.
Referenced by WDataSetPoints().
|
virtual |
Determines whether this dataset can be used as a texture.
Reimplemented from WDataSet.
Definition at line 128 of file WDataSetPoints.cpp.
bool WDataSetPoints::isValidPointIdx | ( | const size_t | pointIdx | ) | const |
Is this a valid point index?
pointIdx | the index to check |
Definition at line 214 of file WDataSetPoints.cpp.
References size().
Referenced by getColor(), and operator[]().
Query coordinates of a given point.
WOutOfBounds | if invalid index is used. |
pointIdx | the point index. |
Definition at line 168 of file WDataSetPoints.cpp.
References isValidPointIdx(), and m_vertices.
Referenced by getPosition().
size_t WDataSetPoints::size | ( | ) | const |
Get number of points in this data set.
Definition at line 123 of file WDataSetPoints.cpp.
References m_vertices.
Referenced by isValidPointIdx().
|
private |
Axis aligned bounding box for all point-vertices of this dataset.
Definition at line 232 of file WDataSetPoints.h.
Referenced by getBoundingBox(), and init().
|
private |
An array of the colors per vertex.
Definition at line 222 of file WDataSetPoints.h.
Referenced by getColor(), getColors(), and init().
|
private |
Which colortype do we use in m_colors.
Definition at line 227 of file WDataSetPoints.h.
Referenced by getColorType(), and init().
|
staticprotected |
The prototype as singleton.
Definition at line 211 of file WDataSetPoints.h.
Referenced by getPrototype().
|
private |
Point vector for all points.
Definition at line 217 of file WDataSetPoints.h.
Referenced by getVertices(), init(), operator[](), and size().