class OESurface : public OESystem::OEBase
OESystem::OEBase and has all the properties thereof. See
Chapter 2 for more information on the concepts that this
class embodies. The OESurface contains the properties in the
following table:
| Property | Get Methods | Set Methods |
| Vertex | GetVertices |
SetVertices |
GetVerticesElement |
SetVerticesElement |
|
| Triangle | GetTriangles |
GetTriangles |
GetTrianglesElement |
GetTrianglesElement |
|
| Face | GetFaceNormals |
SetFaceNormals |
| Normal | GetFaceNormalsElement |
SetFaceNormalsElement |
| Vertex | GetNormals |
SetNormals |
| Normal | GetNormalsElement |
SetNormalsElement |
| Curvature | GetCurvature |
SetCurvature |
GetCurvatureElement |
SetCurvatureElement |
|
| Distance | GetDistances |
SetDistances |
GetDistancesElement |
SetDistancesElement |
|
| Atom | GetAtoms |
SetAtoms |
| Index | GetAtomsElement |
SetAtomsElement |
| Color | GetColor |
SetColor |
GetColorElement |
SetColorElement |
|
| Potential | GetPotential |
SetPotential |
GetPotentialElement |
SetPotentialElement |
|
| Vertex Clique | GetVertexClique |
SetVertexClique |
GetVertexCliqueElement |
SetVertexCliqueElement |
OESurface objects provide two types of access methods: entire
array copy and individual array element access. The methods with the
Element suffix will get or set one element at a time and
require that an index, unsigned int n, be specified.
Each array has a specific size based upon the number of vertices and triangles of the surface. Some properties are also multidimensional and require more space. The following is a table with the appropriate type and size for each property:
| Property | Type | Size |
| Vertex | float |
GetNumVertices()*3 |
| Triangle | unsigned int |
GetNumTriangles()*3 |
| Face | float |
GetNumTriangles()*3 |
| Normal | ||
| Vertex | float |
GetNumVertices()*3 |
| Normal | ||
| Curvature | float |
GetNumVertices() |
| Distance | float |
GetNumVertices() |
| Atom | unsigned int |
GetNumVertices() |
| Index | ||
| Color | float or |
GetNumVertices() * 4 |
unsigned char |
||
| Potential | float |
GetNumVertices() |
| Vertex Clique | unsigned int |
GetNumVertices() |
OESurface() OESurface(const OESurface &rhs)
operator bool() const
OESurface &operator+=(const OESurface &rhs)
rhs are increased by
GetNumVertices(). All other data is copied from rhs as
well. In the case where one of the surfaces does not have data and the
other does, the data array for the surface that does not will be
zero'd out.
OESurface &operator=(const OESurface &rhs)
rhs
to the surface.
void Clear()
OEBase data as well.
bool ClearVertexClique()
IsVertexCliqueSet() will return false. This will prevent
vertex clique values from being output by OEWriteSurface.
virtual OESystem::OEBase *CreateCopy() const
bool GetAtoms(unsigned int *atoms) const
atoms with the atom index
associated with every vertex of the surface. The array passed in
should be of at least size GetNumVertices() *
sizeof(unsigned int). See Section 2.1.5 for more information on
the atoms associated with the surface.
unsigned int GetAtomsElement(unsigned int n) const
n should be less than GetNumVertices(). See
Section 2.1.5 for more information on the atoms
associated with the surface.
bool GetColor(float *color) const bool GetColor(unsigned char *color) const
color with the color associated
with every vertex of the surface. The array passed in should be of at
least size GetNumVertices() * 4 * sizeof(float) or
GetNumVertices() * 4 * sizeof(unsigned char), depending on which
overload is used. See Section 2.1.5 for more
information on colors.
void GetColorElement(unsigned int n, float &r, float &g, float &b, float &a) const
void GetColorElement(unsigned int n, unsigned char &r, unsigned char &g,
unsigned char &b, unsigned char &a) const
n should be less than GetNumVertices(). See
Section 2.1.5 for more information on colors.
bool GetCurvature(float *curvature) const
curvature with the curvature
associated with every vertex of the surface. The array passed in
should be of at least size GetNumVertices() *
sizeof(float). See Section 2.1.4 for more information on
curvature.
float GetCurvatureElement(unsigned int n) const
n should be less than GetNumVertices(). See
Section 2.1.4 for more information on curvature.
virtual const void *GetDataType() const
bool GetDistance(float *distance) const
distance with the
distance each vertex is from another object. The array passed in
should be of at least size GetNumVertices() *
sizeof(float). See Section 2.1.4 for more information on
vertex distances.
float GetDistanceElement(unsigned int n) const
n should be less than GetNumVertices(). See
Section 2.1.4 for more information on vertex distances.
bool GetFaceNormals(float *faceNormals) const
faceNormals with a normal vector
associated with every triangle of the surface. The array passed in
should be of at least size GetNumTriangles() * 3 *
sizeof(float). See Section 2.1.3 for more information
on normal vectors.
float GetFaceNormalsElement(unsigned int n) const
n should be less than GetNumTriangles() * 3. Note
that each individual vector is composed of three floats: a float for
every component of the vector. The user will normally need to call
this function three times incrementing n by one each time to
obtain the full 3-dimensional vector. See Section 2.1.3
for more information on normal vectors.
bool GetNormals(float *normals) const
normals with a normal vector
associated with every vertex of the surface. The array passed in
should be of at least size GetNumVertices() * 3 *
sizeof(float). A vertex normal is calculated by averaging the face
normals of all the triangles in which the vertex resides. See
Section 2.1.3 for more information on normal vectors.
float GetNormalsElement(unsigned int n) const
n should be less than GetNumVertices() *
3. Note that each individual vector is composed of three floats: a
float for every component of the vector. The user will normally need
to call this function three times incrementing n by one each
time to obtain the full 3-dimensional vector. See
Section 2.1.3 for more information on normal vectors.
unsigned int GetNumTriangles() const
unsigned int GetNumVertices() const
bool GetPotential(float *potential) const
potential with the potential
associated with every vertex of the surface. The array passed in
should be of at least size GetNumVertices() *
sizeof(float).
float GetPotentialElement(unsigned int n) const
n should be less than GetNumVertices().
const char *GetPotentialName() const
float GetResolution() const
const char *GetTitle() const
bool GetTriangles(unsigned int *triangles) const
triangles with the vertex
indices that compose every triangle in the surface. The vertex indices
will obey the clockwise ordering rule described in
Section 2.1.2. The array passed in should be of at least
size GetNumTriangles() * 3 * sizeof(unsigned int).
unsigned int GetTrianglesElement(unsigned int n) const
n should be less than GetNumTriangles() * 3. Note
that each individual triangle is composed of three integers. The user will
normally need to call this function three times incrementing n
by one each time to obtain all three vertices of the triangle. See
Section 2.1.2 for more information on triangles.
bool GetVertexClique(unsigned int *vertexClique) const
vertexClique with the clique
values associated with every vertex of the surface. The array passed
in should be of at least size GetNumVertices() * sizeof(unsigned
int). See Section 2.3.1 for more information on cliques.
unsigned int GetVertexCliqueElement(unsigned int n) const
n should be less than GetNumVertices(). See
Section 2.3.1 for more information on cliques.
bool GetVertices(float *vertices) const
vertices with the vertex
coordinates of the surface. Vertices are aligned every three places in
the array as described in Section 2.1.1. The array passed in
should be of at least size GetNumVertices() * 3 *
sizeof(float).
float GetVerticesElement(unsigned int n) const
n should be less than GetNumVertices() * 3. Note
that each individual vertex is composed of three floats. The user will
normally need to call this function three times, incrementing n
by one each time, to obtain all three dimensions of the vertex. See
Section 2.1.1 for more information on vertices.
bool IsAtomsSet() const
OEMakeAccessibleSurface and
OEMakeAccessibleSurface automatically set this data.
bool IsColorSet() const
bool IsCurvatureSet() const
virtual bool IsDataType(const void *type) const
bool IsDistanceSet() const
bool IsFaceNormalsSet() const
bool IsNormalsSet() const
OEMakeAccessibleSurface and
OEMakeAccessibleSurface automatically set this data.
bool IsPotentialSet() const
bool IsVertexCliqueSet() const
bool SetAtoms(const unsigned int *atoms)
atoms. This should be a pointer to an array of unsigned
ints of length GetNumVertices() * sizeof(unsigned int). See
Section 2.1.5 for more information on associative
data. Returns true upon success.
bool SetAtomsElement(unsigned int n, unsigned int value)
n should
be less than GetNumVertices(). See
Section 2.1.5 for more information on associative
data. Returns true upon success.
bool SetColor(const float *color) bool SetColor(const unsigned char *color)
color. This should be a pointer to an array of floats or
unsigned chars of length GetNumVertices() * 4 *
sizeof(float) or GetNumVertices() * 4 * sizeof(unsigned char)
respectively. See Section 2.1.5 for more information
on associative data. Returns true upon success.
bool SetColorElement(unsigned int n, float r, float g, float b, float a=1.0f)
bool SetColorElement(unsigned int n, unsigned char r, unsigned char g,
unsigned char b, unsigned char a=255)
n should
be less than GetNumVertices(). The alpha value, a, defaults to be
opaque. See Section 2.1.5 for more information on
associative data. Returns true upon success.
bool SetCurvature(const float *curvature)
curvature. This should be a pointer to an array of
floats of length GetNumVertices() * sizeof(float). See
Section 2.1.4 for more information on surface
curvature. Returns true upon success.
bool SetCurvatureElement(unsigned int n, float value)
n
should be less than GetNumVertices(). See
Section 2.1.4 for more information on surface
curvature. Returns true upon success.
bool SetDistance(const float *distance)
distance. This should be a pointer to an array of
floats of length GetNumVertices() * sizeof(float). See
Section 2.1.4 for more information on surface
distances. Returns true upon success.
bool SetDistanceElement(unsigned int n, float value)
n
should be less than GetNumVertices(). See
Section 2.1.4 for more information on surface
distances. Returns true upon success.
bool SetFaceNormals(const float *faceNormals)
faceNormals. This should be a pointer to an array of
floats of length GetNumTriangles() * 3 *
sizeof(float). Face normals are associated with triangles by their
location in the array. See Section 2.1.3 for more
information on surface normals. Returns true upon success.
bool SetFaceNormalsElement(unsigned int n, float value)
n
should be less than GetNumTriangles()*3. Note that each
individual vector is composed of three floats: a float for every
component of the vector. The user will normally need to call this
function three times incrementing n by one each time to obtain
the full 3-dimensional vector. See Section 2.1.3 for more
information on surface normals. Returns true upon success.
bool SetNormals(const float *normals)
normals. This should be a pointer to an array of
floats of length GetNumVertices() * 3 *
sizeof(float). Vertex normals are associated with vertices by their
location in the array. See Section 2.1.3 for more
information on surface normals. Returns true upon success.
bool SetNormalsElement(unsigned int n, float value)
n
should be less than GetNumVertices()*3. Note that each
individual vector is composed of three floats: a float for every
component of the vector. The user will normally need to call this
function three times, incrementing n by one each time, to obtain
the full 3-dimensional vector. See Section 2.1.3 for more
information on surface normals. Returns true upon success.
bool SetNumTriangles(unsigned int n)
Set the number of triangles in this surface. Setting this to a value
lower than GetNumTriangles() effectively erases triangles from
the surface. The memory for the OESurface is not freed
immediately, but cached for reuse. The Clear method
should be used if deallocation is desired. This is handled
automatically by the class destructor ÕESurface.
If the user wants to add more triangles to the surface,
SetNumTriangles should be called first to resize the internal
triangles array. Note that the *Element methods should not be
used after a call to SetNumTriangles. Any data reliant on the
number of triangles should first be set using the array based
methods. This includes SetTriangles and SetFaceNormals.
bool SetNumVertices(unsigned int n)
Set the number of vertices in this surface. Setting this to a value
lower than GetNumVertices() effectively erases vertices from
the surface. The memory for the OESurface is not freed
immediately, but cached for reuse. The Clear method
should be used if deallocation is desired. This is handled
automatically by the class destructor ÕESurface.
If the user wants to add more vertices to the surface,
SetNumVerices should be called first to resize the internal
vertices array. Note that the *Element methods should not be
used after a call to SetNumVertices. Any data reliant on the
number of vertices should first be set using the array based
methods. These include the following: SetVertices,
SetNormals, SetCurvature, SetDistance,
SetAtoms, SetColor, SetPotential, and
SetVertexClique.
bool SetPotential(const float *potential)
potential. This should be a pointer to an array of
floats of length GetNumVertices() *
sizeof(float). Returns true upon success.
bool SetPotentialElement(unsigned int n, float value)
n
should be less than GetNumVertices(). Returns true upon
success.
void SetPotentialName(const char *name)
bool SetTitle(const char *title) bool SetTitle(const std::string &title)
bool SetTriangles(const unsigned int *triangles)
triangles. This should be a pointer to an array of
unsigned ints of length GetNumTriangles() * 3 *
sizeof(unsigned int). See Section 2.1.2 for more
information on triangles. Returns true upon success.
bool SetTrianglesElement(unsigned int n, unsigned int value)
n
should be less than GetNumTriangles()*3. See
Section 2.1.2 for more information on triangles. Returns
true upon success.
bool SetVertexClique(const unsigned int *vertexClique)
vertexClique. This should be a pointer to an array of
unsigned ints of length GetNumVertices() *
sizeof(unsigned int). See Section 2.3.1 for more information
on cliques. Returns true upon success.
bool SetVertexCliqueElement(unsigned int n, unsigned int value)
n should be less than GetNumVertices(). See
Section 2.3.1 for more information on cliques. Returns
true upon success.
bool SetVertices(const float *vertices)
vertices. This should be a pointer to an array of floats
of length GetNumVertices() * 3 * sizeof(float). See
Section 2.1.1 for more information on vertices. Returns
true upon success.
bool SetVerticesElement(unsigned int n, float value)
n
should be less than GetNumVertices()*3. See
Section 2.1.1 for more information on vertices. Returns
true upon success.