Replacing Array class with another Array class
This commit is contained in:
1 parent
d33c1abd71
commit
ef25839769
28 files changed
+1099
-1050
No files matched your search
+22
-21
@@ -1,5 +1,6 @@
|
||||
#include "Mesh.h"
|
||||
#include "common/Utilities.h"
|
||||
#include "shared_ptr.h"
|
||||
|
||||
#include <limits>
|
||||
#include <stdint.h>
|
||||
@@ -192,7 +193,7 @@ TriMesh::TriMesh( size_t N_tri, size_t N_point )
|
||||
B.resize(N_tri,-1);
|
||||
C.resize(N_tri,-1);
|
||||
}
|
||||
TriMesh::TriMesh( size_t N_tri, shared_ptr<PointList> points )
|
||||
TriMesh::TriMesh( size_t N_tri, std::shared_ptr<PointList> points )
|
||||
{
|
||||
vertices = points;
|
||||
A.resize(N_tri,-1);
|
||||
@@ -293,45 +294,45 @@ void TriMesh::unpack( const std::pair<size_t,void*>& data_in )
|
||||
/****************************************************
|
||||
* Converters *
|
||||
****************************************************/
|
||||
shared_ptr<PointList> getPointList( shared_ptr<Mesh> mesh )
|
||||
std::shared_ptr<PointList> getPointList( std::shared_ptr<Mesh> mesh )
|
||||
{
|
||||
return dynamic_pointer_cast<PointList>(mesh);
|
||||
return std::dynamic_pointer_cast<PointList>(mesh);
|
||||
}
|
||||
shared_ptr<TriMesh> getTriMesh( shared_ptr<Mesh> mesh )
|
||||
std::shared_ptr<TriMesh> getTriMesh( std::shared_ptr<Mesh> mesh )
|
||||
{
|
||||
shared_ptr<TriMesh> mesh2;
|
||||
if ( dynamic_pointer_cast<TriMesh>(mesh).get() != NULL ) {
|
||||
mesh2 = dynamic_pointer_cast<TriMesh>(mesh);
|
||||
} else if ( dynamic_pointer_cast<TriList>(mesh).get() != NULL ) {
|
||||
shared_ptr<TriList> trilist = dynamic_pointer_cast<TriList>(mesh);
|
||||
std::shared_ptr<TriMesh> mesh2;
|
||||
if ( std::dynamic_pointer_cast<TriMesh>(mesh).get() != NULL ) {
|
||||
mesh2 = std::dynamic_pointer_cast<TriMesh>(mesh);
|
||||
} else if ( std::dynamic_pointer_cast<TriList>(mesh).get() != NULL ) {
|
||||
std::shared_ptr<TriList> trilist = std::dynamic_pointer_cast<TriList>(mesh);
|
||||
ASSERT(trilist.get()!=NULL);
|
||||
mesh2.reset( new TriMesh(*trilist) );
|
||||
}
|
||||
return mesh2;
|
||||
}
|
||||
shared_ptr<TriList> getTriList( shared_ptr<Mesh> mesh )
|
||||
std::shared_ptr<TriList> getTriList( std::shared_ptr<Mesh> mesh )
|
||||
{
|
||||
shared_ptr<TriList> mesh2;
|
||||
if ( dynamic_pointer_cast<TriList>(mesh).get() != NULL ) {
|
||||
mesh2 = dynamic_pointer_cast<TriList>(mesh);
|
||||
} else if ( dynamic_pointer_cast<TriMesh>(mesh).get() != NULL ) {
|
||||
shared_ptr<TriMesh> trimesh = dynamic_pointer_cast<TriMesh>(mesh);
|
||||
std::shared_ptr<TriList> mesh2;
|
||||
if ( std::dynamic_pointer_cast<TriList>(mesh).get() != NULL ) {
|
||||
mesh2 = std::dynamic_pointer_cast<TriList>(mesh);
|
||||
} else if ( std::dynamic_pointer_cast<TriMesh>(mesh).get() != NULL ) {
|
||||
std::shared_ptr<TriMesh> trimesh = std::dynamic_pointer_cast<TriMesh>(mesh);
|
||||
ASSERT(trimesh.get()!=NULL);
|
||||
mesh2.reset( new TriList(*trimesh) );
|
||||
}
|
||||
return mesh2;
|
||||
}
|
||||
shared_ptr<const PointList> getPointList( shared_ptr<const Mesh> mesh )
|
||||
std::shared_ptr<const PointList> getPointList( std::shared_ptr<const Mesh> mesh )
|
||||
{
|
||||
return getPointList( const_pointer_cast<Mesh>(mesh) );
|
||||
return getPointList( std::const_pointer_cast<Mesh>(mesh) );
|
||||
}
|
||||
shared_ptr<const TriMesh> getTriMesh( shared_ptr<const Mesh> mesh )
|
||||
std::shared_ptr<const TriMesh> getTriMesh( std::shared_ptr<const Mesh> mesh )
|
||||
{
|
||||
return getTriMesh( const_pointer_cast<Mesh>(mesh) );
|
||||
return getTriMesh( std::const_pointer_cast<Mesh>(mesh) );
|
||||
}
|
||||
shared_ptr<const TriList> getTriList( shared_ptr<const Mesh> mesh )
|
||||
std::shared_ptr<const TriList> getTriList( std::shared_ptr<const Mesh> mesh )
|
||||
{
|
||||
return getTriList( const_pointer_cast<Mesh>(mesh) );
|
||||
return getTriList( std::const_pointer_cast<Mesh>(mesh) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user