Fixed explicit making cppcheck fail and some lineendings
This commit is contained in:
@@ -85,7 +85,7 @@ class SoOpenMeshNodeT : public SoShape
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
static void initClass();
|
static void initClass();
|
||||||
SoOpenMeshNodeT(const Mesh* _mesh=0);
|
explicit SoOpenMeshNodeT(const Mesh* _mesh=0);
|
||||||
void setMesh(const Mesh* mesh) { d_mesh = mesh; }
|
void setMesh(const Mesh* mesh) { d_mesh = mesh; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ template <class T>
|
|||||||
class multiplex_target : public basic_multiplex_target
|
class multiplex_target : public basic_multiplex_target
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
multiplex_target(T& _t) : target_(_t) {}
|
explicit multiplex_target(T& _t) : target_(_t) {}
|
||||||
virtual void operator<<(const std::string& _s) { target_ << _s; }
|
virtual void operator<<(const std::string& _s) { target_ << _s; }
|
||||||
private:
|
private:
|
||||||
T& target_;
|
T& target_;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @param _resolution specifies the desired resolution for the random number generated
|
* @param _resolution specifies the desired resolution for the random number generated
|
||||||
*/
|
*/
|
||||||
RandomNumberGenerator(const size_t _resolution);
|
explicit RandomNumberGenerator(const size_t _resolution);
|
||||||
|
|
||||||
/// returns a random double between 0.0 and 1.0 with a guaranteed resolution
|
/// returns a random double between 0.0 and 1.0 with a guaranteed resolution
|
||||||
double getRand() const;
|
double getRand() const;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @param _notificationInterval Interval of decimation steps between notifications.
|
* @param _notificationInterval Interval of decimation steps between notifications.
|
||||||
*/
|
*/
|
||||||
Observer(size_t _notificationInterval);
|
explicit Observer(size_t _notificationInterval);
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~Observer();
|
virtual ~Observer();
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public:
|
|||||||
CatmullClarkT( ) : parent_t() { }
|
CatmullClarkT( ) : parent_t() { }
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
CatmullClarkT(MeshType &_m) : parent_t(_m) { }
|
explicit CatmullClarkT(MeshType &_m) : parent_t(_m) { }
|
||||||
|
|
||||||
virtual ~CatmullClarkT() {}
|
virtual ~CatmullClarkT() {}
|
||||||
|
|
||||||
|
|||||||
@@ -37,215 +37,215 @@
|
|||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||||
* *
|
* *
|
||||||
* ========================================================================= */
|
* ========================================================================= */
|
||||||
|
|
||||||
/*===========================================================================*\
|
/*===========================================================================*\
|
||||||
* *
|
* *
|
||||||
* $Revision$ *
|
* $Revision$ *
|
||||||
* $Date$ *
|
* $Date$ *
|
||||||
* *
|
* *
|
||||||
\*===========================================================================*/
|
\*===========================================================================*/
|
||||||
|
|
||||||
/** \file Uniform/Composite/CompositeT.hh
|
/** \file Uniform/Composite/CompositeT.hh
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
// CLASS CompositeT
|
// CLASS CompositeT
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH
|
#ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH
|
||||||
#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH
|
#define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_HH
|
||||||
|
|
||||||
|
|
||||||
//== INCLUDES =================================================================
|
//== INCLUDES =================================================================
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
// --------------------
|
// --------------------
|
||||||
#include <OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh>
|
#include <OpenMesh/Tools/Subdivider/Uniform/SubdividerT.hh>
|
||||||
|
|
||||||
//== NAMESPACE ================================================================
|
//== NAMESPACE ================================================================
|
||||||
|
|
||||||
namespace OpenMesh { // BEGIN_NS_OPENMESH
|
namespace OpenMesh { // BEGIN_NS_OPENMESH
|
||||||
namespace Subdivider { // BEGIN_NS_DECIMATER
|
namespace Subdivider { // BEGIN_NS_DECIMATER
|
||||||
namespace Uniform { // BEGIN_NS_UNIFORM
|
namespace Uniform { // BEGIN_NS_UNIFORM
|
||||||
|
|
||||||
|
|
||||||
//== CLASS DEFINITION =========================================================
|
//== CLASS DEFINITION =========================================================
|
||||||
|
|
||||||
/** This class provides the composite subdivision rules for the uniform case.
|
/** This class provides the composite subdivision rules for the uniform case.
|
||||||
*
|
*
|
||||||
* To create a subdivider derive from this class and overload the functions
|
* To create a subdivider derive from this class and overload the functions
|
||||||
* name() and apply_rules(). In the latter one call the wanted rules.
|
* name() and apply_rules(). In the latter one call the wanted rules.
|
||||||
*
|
*
|
||||||
* For details on the composite scheme refer to
|
* For details on the composite scheme refer to
|
||||||
* - <a
|
* - <a
|
||||||
* href="http://cm.bell-labs.com/who/poswald/sqrt3.pdf">P. Oswald,
|
* href="http://cm.bell-labs.com/who/poswald/sqrt3.pdf">P. Oswald,
|
||||||
* P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes",
|
* P. Schroeder "Composite primal/dual sqrt(3)-subdivision schemes",
|
||||||
* CAGD 20, 3, 2003, 135--164</a>
|
* CAGD 20, 3, 2003, 135--164</a>
|
||||||
|
|
||||||
* \note Not all rules are implemented!
|
* \note Not all rules are implemented!
|
||||||
* \see class Adaptive::CompositeT
|
* \see class Adaptive::CompositeT
|
||||||
*/
|
*/
|
||||||
template <typename MeshType, typename RealType=float >
|
template <typename MeshType, typename RealType=float >
|
||||||
class CompositeT : public SubdividerT< MeshType, RealType >
|
class CompositeT : public SubdividerT< MeshType, RealType >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef RealType real_t;
|
typedef RealType real_t;
|
||||||
typedef MeshType mesh_t;
|
typedef MeshType mesh_t;
|
||||||
typedef SubdividerT< mesh_t, real_t > parent_t;
|
typedef SubdividerT< mesh_t, real_t > parent_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CompositeT(void) : parent_t(), p_mesh_(NULL) {}
|
CompositeT(void) : parent_t(), p_mesh_(NULL) {}
|
||||||
CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {};
|
explicit CompositeT(MeshType& _mesh) : parent_t(_mesh), p_mesh_(NULL) {};
|
||||||
virtual ~CompositeT() { }
|
virtual ~CompositeT() { }
|
||||||
|
|
||||||
public: // inherited interface
|
public: // inherited interface
|
||||||
|
|
||||||
virtual const char *name( void ) const = 0;
|
virtual const char *name( void ) const = 0;
|
||||||
|
|
||||||
protected: // inherited interface
|
protected: // inherited interface
|
||||||
|
|
||||||
bool prepare( MeshType& _m );
|
bool prepare( MeshType& _m );
|
||||||
|
|
||||||
bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true )
|
bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true )
|
||||||
{
|
{
|
||||||
assert( p_mesh_ == &_m );
|
assert( p_mesh_ == &_m );
|
||||||
|
|
||||||
while(_n--)
|
while(_n--)
|
||||||
{
|
{
|
||||||
apply_rules();
|
apply_rules();
|
||||||
commit(_m);
|
commit(_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
bool cleanup( MeshType& )
|
bool cleanup( MeshType& )
|
||||||
#else
|
#else
|
||||||
bool cleanup( MeshType& _m )
|
bool cleanup( MeshType& _m )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
assert( p_mesh_ == &_m );
|
assert( p_mesh_ == &_m );
|
||||||
p_mesh_=NULL;
|
p_mesh_=NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// Assemble here the rule sequence, by calling the constructor
|
/// Assemble here the rule sequence, by calling the constructor
|
||||||
/// of the wanted rules.
|
/// of the wanted rules.
|
||||||
virtual void apply_rules(void) = 0;
|
virtual void apply_rules(void) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// Move vertices to new positions after the rules have been applied
|
/// Move vertices to new positions after the rules have been applied
|
||||||
/// to the mesh (called by subdivide()).
|
/// to the mesh (called by subdivide()).
|
||||||
void commit( MeshType &_m)
|
void commit( MeshType &_m)
|
||||||
{
|
{
|
||||||
typename MeshType::VertexIter v_it;
|
typename MeshType::VertexIter v_it;
|
||||||
|
|
||||||
for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it)
|
for (v_it=_m.vertices_begin(); v_it != _m.vertices_end(); ++v_it)
|
||||||
_m.set_point(*v_it, _m.data(*v_it).position());
|
_m.set_point(*v_it, _m.data(*v_it).position());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Abstract base class for coefficient functions
|
/// Abstract base class for coefficient functions
|
||||||
struct Coeff
|
struct Coeff
|
||||||
{
|
{
|
||||||
virtual ~Coeff() { }
|
virtual ~Coeff() { }
|
||||||
virtual double operator() (size_t _valence) = 0;
|
virtual double operator() (size_t _valence) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
typedef typename MeshType::Scalar scalar_t;
|
typedef typename MeshType::Scalar scalar_t;
|
||||||
typedef typename MeshType::VertexHandle VertexHandle;
|
typedef typename MeshType::VertexHandle VertexHandle;
|
||||||
typedef typename MeshType::FaceHandle FaceHandle;
|
typedef typename MeshType::FaceHandle FaceHandle;
|
||||||
typedef typename MeshType::EdgeHandle EdgeHandle;
|
typedef typename MeshType::EdgeHandle EdgeHandle;
|
||||||
typedef typename MeshType::HalfedgeHandle HalfedgeHandle;
|
typedef typename MeshType::HalfedgeHandle HalfedgeHandle;
|
||||||
|
|
||||||
/// \name Uniform composite subdivision rules
|
/// \name Uniform composite subdivision rules
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
|
|
||||||
void Tvv3(); ///< Split Face, using Vertex information (1-3 split)
|
void Tvv3(); ///< Split Face, using Vertex information (1-3 split)
|
||||||
void Tvv4(); ///< Split Face, using Vertex information (1-4 split)
|
void Tvv4(); ///< Split Face, using Vertex information (1-4 split)
|
||||||
void Tfv(); ///< Split Face, using Face Information
|
void Tfv(); ///< Split Face, using Face Information
|
||||||
|
|
||||||
void FF(); ///< Face to face averaging.
|
void FF(); ///< Face to face averaging.
|
||||||
void FFc(Coeff& _coeff); ///< Weighted face to face averaging.
|
void FFc(Coeff& _coeff); ///< Weighted face to face averaging.
|
||||||
void FFc(scalar_t _c); ///< Weighted face to face averaging.
|
void FFc(scalar_t _c); ///< Weighted face to face averaging.
|
||||||
|
|
||||||
void FV(); ///< Face to vertex averaging.
|
void FV(); ///< Face to vertex averaging.
|
||||||
void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps
|
void FVc(Coeff& _coeff); ///< Weighted face to vertex Averaging with flaps
|
||||||
void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps
|
void FVc(scalar_t _c); ///< Weighted face to vertex Averaging with flaps
|
||||||
|
|
||||||
void FE(); ///< Face to edge averaging.
|
void FE(); ///< Face to edge averaging.
|
||||||
|
|
||||||
void VF(); ///< Vertex to Face Averaging.
|
void VF(); ///< Vertex to Face Averaging.
|
||||||
void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted.
|
void VFa(Coeff& _coeff); ///< Vertex to Face Averaging, weighted.
|
||||||
void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted.
|
void VFa(scalar_t _alpha); ///< Vertex to Face Averaging, weighted.
|
||||||
|
|
||||||
void VV(); ///< Vertex to vertex averaging.
|
void VV(); ///< Vertex to vertex averaging.
|
||||||
void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted.
|
void VVc(Coeff& _coeff); ///< Vertex to vertex averaging, weighted.
|
||||||
void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted.
|
void VVc(scalar_t _c); ///< Vertex to vertex averaging, weighted.
|
||||||
|
|
||||||
void VE(); ///< VE Step (Vertex to Edge Averaging)
|
void VE(); ///< VE Step (Vertex to Edge Averaging)
|
||||||
|
|
||||||
|
|
||||||
void VdE(); ///< Vertex to edge averaging, using diamond of edges.
|
void VdE(); ///< Vertex to edge averaging, using diamond of edges.
|
||||||
void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges
|
void VdEc(scalar_t _c); ///< Weighted vertex to edge averaging, using diamond of edges
|
||||||
|
|
||||||
/// Weigthed vertex to edge averaging, using diamond of edges for
|
/// Weigthed vertex to edge averaging, using diamond of edges for
|
||||||
/// irregular vertices.
|
/// irregular vertices.
|
||||||
void VdEg(Coeff& _coeff);
|
void VdEg(Coeff& _coeff);
|
||||||
/// Weigthed vertex to edge averaging, using diamond of edges for
|
/// Weigthed vertex to edge averaging, using diamond of edges for
|
||||||
/// irregular vertices.
|
/// irregular vertices.
|
||||||
void VdEg(scalar_t _gamma);
|
void VdEg(scalar_t _gamma);
|
||||||
|
|
||||||
void EF(); ///< Edge to face averaging.
|
void EF(); ///< Edge to face averaging.
|
||||||
|
|
||||||
void EV(); ///< Edge to vertex averaging.
|
void EV(); ///< Edge to vertex averaging.
|
||||||
void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging.
|
void EVc(Coeff& _coeff); ///< Weighted edge to vertex averaging.
|
||||||
void EVc(scalar_t _c); ///< Weighted edge to vertex averaging.
|
void EVc(scalar_t _c); ///< Weighted edge to vertex averaging.
|
||||||
|
|
||||||
void EdE(); ///< Edge to edge averaging w/ flap rule.
|
void EdE(); ///< Edge to edge averaging w/ flap rule.
|
||||||
void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule.
|
void EdEc(scalar_t _c); ///< Weighted edge to edge averaging w/ flap rule.
|
||||||
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void corner_cutting(HalfedgeHandle _heh);
|
void corner_cutting(HalfedgeHandle _heh);
|
||||||
|
|
||||||
VertexHandle split_edge(HalfedgeHandle _heh);
|
VertexHandle split_edge(HalfedgeHandle _heh);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MeshType* p_mesh_;
|
MeshType* p_mesh_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
} // END_NS_UNIFORM
|
} // END_NS_UNIFORM
|
||||||
} // END_NS_SUBDIVIDER
|
} // END_NS_SUBDIVIDER
|
||||||
} // END_NS_OPENMESH
|
} // END_NS_OPENMESH
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC)
|
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITE_CC)
|
||||||
#define OPENMESH_SUBDIVIDER_TEMPLATES
|
#define OPENMESH_SUBDIVIDER_TEMPLATES
|
||||||
#include "CompositeT.cc"
|
#include "CompositeT.cc"
|
||||||
#endif
|
#endif
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
#endif // COMPOSITET_HH defined
|
#endif // COMPOSITET_HH defined
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
|
|
||||||
/// Constructor to be used with interface 1 (calls attach())
|
/// Constructor to be used with interface 1 (calls attach())
|
||||||
/// \see operator()( MeshType&, size_t )
|
/// \see operator()( MeshType&, size_t )
|
||||||
SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); }
|
explicit SubdividerT( MeshType &_m ) : attached_(NULL) { attach(_m); }
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ using namespace std;
|
|||||||
class GnuplotException : public runtime_error
|
class GnuplotException : public runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GnuplotException(const string &msg) : runtime_error(msg){}
|
explicit GnuplotException(const string &msg) : runtime_error(msg){}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
Gnuplot();
|
Gnuplot();
|
||||||
|
|
||||||
/// Set a style during construction.
|
/// Set a style during construction.
|
||||||
Gnuplot(const string & _style);
|
explicit Gnuplot(const string & _style);
|
||||||
|
|
||||||
/// Constructor calling plot_xy().
|
/// Constructor calling plot_xy().
|
||||||
Gnuplot(const string & _title,
|
Gnuplot(const string & _title,
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class MeshCheckerT
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/// constructor
|
/// constructor
|
||||||
MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {}
|
explicit MeshCheckerT(const Mesh& _mesh) : mesh_(_mesh) {}
|
||||||
|
|
||||||
/// destructor
|
/// destructor
|
||||||
~MeshCheckerT() {}
|
~MeshCheckerT() {}
|
||||||
|
|||||||
@@ -37,97 +37,97 @@
|
|||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
|
||||||
* *
|
* *
|
||||||
* ========================================================================= */
|
* ========================================================================= */
|
||||||
|
|
||||||
/*===========================================================================*\
|
/*===========================================================================*\
|
||||||
* *
|
* *
|
||||||
* $Revision$ *
|
* $Revision$ *
|
||||||
* $Date$ *
|
* $Date$ *
|
||||||
* *
|
* *
|
||||||
\*===========================================================================*/
|
\*===========================================================================*/
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
// CLASS newClass
|
// CLASS newClass
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH
|
#ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH
|
||||||
#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH
|
#define OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH
|
||||||
|
|
||||||
//== INCLUDES =================================================================
|
//== INCLUDES =================================================================
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
//== FORWARDDECLARATIONS ======================================================
|
//== FORWARDDECLARATIONS ======================================================
|
||||||
|
|
||||||
|
|
||||||
//== NAMESPACES ===============================================================
|
//== NAMESPACES ===============================================================
|
||||||
|
|
||||||
namespace OpenMesh {
|
namespace OpenMesh {
|
||||||
namespace VDPM {
|
namespace VDPM {
|
||||||
|
|
||||||
//== CLASS DEFINITION =========================================================
|
//== CLASS DEFINITION =========================================================
|
||||||
|
|
||||||
|
|
||||||
/** Index of vertex hierarchy node
|
/** Index of vertex hierarchy node
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class VHierarchyNodeIndex
|
class VHierarchyNodeIndex
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned int value_;
|
unsigned int value_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static const VHierarchyNodeIndex InvalidIndex;
|
static const VHierarchyNodeIndex InvalidIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VHierarchyNodeIndex()
|
VHierarchyNodeIndex()
|
||||||
{ value_ = 0; }
|
{ value_ = 0; }
|
||||||
|
|
||||||
VHierarchyNodeIndex(unsigned int _value)
|
explicit VHierarchyNodeIndex(unsigned int _value)
|
||||||
{ value_ = _value; }
|
{ value_ = _value; }
|
||||||
|
|
||||||
VHierarchyNodeIndex(const VHierarchyNodeIndex &_other)
|
VHierarchyNodeIndex(const VHierarchyNodeIndex &_other)
|
||||||
{ value_ = _other.value_; }
|
{ value_ = _other.value_; }
|
||||||
|
|
||||||
VHierarchyNodeIndex(unsigned int _tree_id,
|
VHierarchyNodeIndex(unsigned int _tree_id,
|
||||||
unsigned int _node_id,
|
unsigned int _node_id,
|
||||||
unsigned short _tree_id_bits)
|
unsigned short _tree_id_bits)
|
||||||
{
|
{
|
||||||
assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits));
|
assert(_tree_id < ((unsigned int) 0x00000001 << _tree_id_bits));
|
||||||
assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits)));
|
assert(_node_id < ((unsigned int) 0x00000001 << (32 - _tree_id_bits)));
|
||||||
value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id;
|
value_ = (_tree_id << (32 - _tree_id_bits)) | _node_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_valid(unsigned short _tree_id_bits) const
|
bool is_valid(unsigned short _tree_id_bits) const
|
||||||
{ return node_id(_tree_id_bits) != 0 ? true : false; }
|
{ return node_id(_tree_id_bits) != 0 ? true : false; }
|
||||||
|
|
||||||
unsigned int tree_id(unsigned short _tree_id_bits) const
|
unsigned int tree_id(unsigned short _tree_id_bits) const
|
||||||
{ return value_ >> (32 - _tree_id_bits); }
|
{ return value_ >> (32 - _tree_id_bits); }
|
||||||
|
|
||||||
unsigned int node_id(unsigned short _tree_id_bits) const
|
unsigned int node_id(unsigned short _tree_id_bits) const
|
||||||
{ return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); }
|
{ return value_ & ((unsigned int) 0xFFFFFFFF >> _tree_id_bits); }
|
||||||
|
|
||||||
bool operator< (const VHierarchyNodeIndex &other) const
|
bool operator< (const VHierarchyNodeIndex &other) const
|
||||||
{ return (value_ < other.value_) ? true : false; }
|
{ return (value_ < other.value_) ? true : false; }
|
||||||
|
|
||||||
unsigned int value() const
|
unsigned int value() const
|
||||||
{ return value_; }
|
{ return value_; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Container for vertex hierarchy node indices
|
/// Container for vertex hierarchy node indices
|
||||||
typedef std::vector<VHierarchyNodeIndex> VHierarchyNodeIndexContainer;
|
typedef std::vector<VHierarchyNodeIndex> VHierarchyNodeIndexContainer;
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
} // namespace VDPM
|
} // namespace VDPM
|
||||||
} // namespace OpenMesh
|
} // namespace OpenMesh
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined
|
#endif // OPENMESH_VDPROGMESH_VHIERARCHYNODEINDEX_HH defined
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user