First working version (tetrahedron!)
This commit is contained in:
parent
71749144a2
commit
f657ab9c6c
|
|
@ -1,68 +1,60 @@
|
||||||
/*#***************************************************************************
|
/****************************************************************************
|
||||||
* VertexBase.h o o *
|
* VCGLib o o *
|
||||||
* o o *
|
* Visual and Computer Graphics Library o o *
|
||||||
* Visual Computing Group _ O _ *
|
* _ O _ *
|
||||||
* IEI Institute, CNUCE Institute, CNR Pisa \/)\/ *
|
* Copyright(C) 2004 \/)\/ *
|
||||||
* /\/| *
|
* Visual Computing Lab /\/| *
|
||||||
* Copyright(C) 1999 by Paolo Cignoni, Claudio Rocchini | *
|
* ISTI - Italian National Research Council | *
|
||||||
* All rights reserved. \ *
|
* \ *
|
||||||
|
* All rights reserved. *
|
||||||
* *
|
* *
|
||||||
* Permission to use, copy, modify, distribute and sell this software and *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* its documentation for any purpose is hereby granted without fee, provided *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
* that the above copyright notice appear in all copies and that both that *
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
* copyright notice and this permission notice appear in supporting *
|
* (at your option) any later version. *
|
||||||
* documentation. the author makes no representations about the suitability *
|
|
||||||
* of this software for any purpose. It is provided "as is" without express *
|
|
||||||
* or implied warranty. *
|
|
||||||
* *
|
* *
|
||||||
*****************************************************************************/
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||||
|
* for more details. *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
History
|
History
|
||||||
|
|
||||||
2000 Jul 23 First Working release (only the tetrahedron)
|
$Log: not supported by cvs2svn $
|
||||||
30 Added Octahedron
|
|
||||||
Aug 4 Added Icosahedron
|
|
||||||
Nov 22 Added Hexahedron (cube)
|
|
||||||
2001 Apr 19 Added HalfOctahedron
|
|
||||||
20 Added Square
|
|
||||||
May 16 Added Sphere Function (CR) (PC)
|
|
||||||
" Cone " " "
|
|
||||||
" Box (CR)
|
|
||||||
Jul 09 Aggiunta Build (CR)
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __VCGLIB_PLATONIC
|
#ifndef __VCGLIB_PLATONIC
|
||||||
#define __VCGLIB_PLATONIC
|
#define __VCGLIB_PLATONIC
|
||||||
|
|
||||||
#include <vcg/Mesh/Refine.h>
|
//#include <vcg/Mesh/Refine.h>
|
||||||
|
#include<vcg/complex/trimesh/allocate.h>
|
||||||
|
namespace vcg {
|
||||||
|
namespace tri {
|
||||||
|
|
||||||
template <class MESH_TYPE>
|
template <class MESH_TYPE>
|
||||||
void Tetrahedron(MESH_TYPE &in)
|
void Tetrahedron(MESH_TYPE &in)
|
||||||
{
|
{
|
||||||
in.vn=4;
|
in.Clear();
|
||||||
in.fn=4;
|
Allocator<MESH_TYPE>::AddVertices(in,4);
|
||||||
in.vert.clear();
|
Allocator<MESH_TYPE>::AddFaces(in,4);
|
||||||
in.face.clear();
|
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
|
||||||
MESH_TYPE::vectorial_type tp;
|
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 1, 1); tv.P()=tp; in.vert.push_back(tv);
|
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 1,-1); tv.P()=tp; in.vert.push_back(tv);
|
|
||||||
tp=MESH_TYPE::vectorial_type (-1,-1, 1); tv.P()=tp; in.vert.push_back(tv);
|
|
||||||
tp=MESH_TYPE::vectorial_type ( 1,-1,-1); tv.P()=tp; in.vert.push_back(tv);
|
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
MESH_TYPE::VertexPointer ivp[4];
|
||||||
|
|
||||||
MESH_TYPE::face_type f;f.Supervisor_Flags()=0;
|
MESH_TYPE::VertexIterator vi=in.vert.begin();
|
||||||
|
ivp[0]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 1, 1, 1); ++vi;
|
||||||
|
ivp[1]=&*vi;(*vi).P()=MESH_TYPE::CoordType (-1, 1,-1); ++vi;
|
||||||
|
ivp[2]=&*vi;(*vi).P()=MESH_TYPE::CoordType (-1,-1, 1); ++vi;
|
||||||
|
ivp[3]=&*vi;(*vi).P()=MESH_TYPE::CoordType ( 1,-1,-1);
|
||||||
|
|
||||||
MESH_TYPE::vertex_iterator vi;
|
MESH_TYPE::FaceIterator fi=in.face.begin();
|
||||||
int j;
|
(*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[1]; (*fi).V(2)=ivp[2]; ++fi;
|
||||||
for(j=0,vi=in.vert.begin();j<in.vn;++j,++vi) index[j] = &*vi;
|
(*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[2]; (*fi).V(2)=ivp[3]; ++fi;
|
||||||
f.V(0)=index[0]; f.V(1)=index[1];f.V(2)=index[2]; in.face.push_back(f);
|
(*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[3]; (*fi).V(2)=ivp[1]; ++fi;
|
||||||
f.V(0)=index[0]; f.V(1)=index[2];f.V(2)=index[3]; in.face.push_back(f);
|
(*fi).V(0)=ivp[3]; (*fi).V(1)=ivp[2]; (*fi).V(2)=ivp[1];
|
||||||
f.V(0)=index[0]; f.V(1)=index[3];f.V(2)=index[1]; in.face.push_back(f);
|
|
||||||
f.V(0)=index[3]; f.V(1)=index[2];f.V(2)=index[1]; in.face.push_back(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MESH_TYPE>
|
template <class MESH_TYPE>
|
||||||
|
|
@ -72,14 +64,14 @@ void Octahedron(MESH_TYPE &in)
|
||||||
in.fn=8;
|
in.fn=8;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 0, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 0, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 0,-1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 0,-1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
||||||
|
|
||||||
|
|
@ -102,22 +94,22 @@ void Octahedron(MESH_TYPE &in)
|
||||||
template <class MESH_TYPE>
|
template <class MESH_TYPE>
|
||||||
void Icosahedron(MESH_TYPE &in)
|
void Icosahedron(MESH_TYPE &in)
|
||||||
{
|
{
|
||||||
MESH_TYPE::scalar_type L=(Sqrt(5.0)+1.0)/2.0;
|
MESH_TYPE::ScalarType L=(Sqrt(5.0)+1.0)/2.0;
|
||||||
MESH_TYPE::vectorial_type vv[12]={
|
MESH_TYPE::CoordType vv[12]={
|
||||||
MESH_TYPE::vectorial_type ( 0, L, 1),
|
MESH_TYPE::CoordType ( 0, L, 1),
|
||||||
MESH_TYPE::vectorial_type ( 0, L,-1),
|
MESH_TYPE::CoordType ( 0, L,-1),
|
||||||
MESH_TYPE::vectorial_type ( 0,-L, 1),
|
MESH_TYPE::CoordType ( 0,-L, 1),
|
||||||
MESH_TYPE::vectorial_type ( 0,-L,-1),
|
MESH_TYPE::CoordType ( 0,-L,-1),
|
||||||
|
|
||||||
MESH_TYPE::vectorial_type ( L, 1, 0),
|
MESH_TYPE::CoordType ( L, 1, 0),
|
||||||
MESH_TYPE::vectorial_type ( L,-1, 0),
|
MESH_TYPE::CoordType ( L,-1, 0),
|
||||||
MESH_TYPE::vectorial_type (-L, 1, 0),
|
MESH_TYPE::CoordType (-L, 1, 0),
|
||||||
MESH_TYPE::vectorial_type (-L,-1, 0),
|
MESH_TYPE::CoordType (-L,-1, 0),
|
||||||
|
|
||||||
MESH_TYPE::vectorial_type ( 1, 0, L),
|
MESH_TYPE::CoordType ( 1, 0, L),
|
||||||
MESH_TYPE::vectorial_type (-1, 0, L),
|
MESH_TYPE::CoordType (-1, 0, L),
|
||||||
MESH_TYPE::vectorial_type ( 1, 0,-L),
|
MESH_TYPE::CoordType ( 1, 0,-L),
|
||||||
MESH_TYPE::vectorial_type (-1, 0,-L)
|
MESH_TYPE::CoordType (-1, 0,-L)
|
||||||
};
|
};
|
||||||
|
|
||||||
int ff[20][3]={
|
int ff[20][3]={
|
||||||
|
|
@ -132,8 +124,8 @@ void Icosahedron(MESH_TYPE &in)
|
||||||
in.fn=20;
|
in.fn=20;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
for(int i=0;i<in.vn;i++)
|
for(int i=0;i<in.vn;i++)
|
||||||
{
|
{
|
||||||
tv.P()=vv[i];
|
tv.P()=vv[i];
|
||||||
|
|
@ -163,16 +155,16 @@ void Hexahedron(MESH_TYPE &in)
|
||||||
in.fn=12;
|
in.fn=12;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
tp=MESH_TYPE::vectorial_type (-1,-1,-1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1,-1,-1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 1,-1,-1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1,-1,-1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 1,-1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1, 1,-1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 1,-1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1, 1,-1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1,-1, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1,-1, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 1,-1, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1,-1, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 1, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1, 1, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 1, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1, 1, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
||||||
|
|
||||||
|
|
@ -207,13 +199,13 @@ void HalfOctahedron(MESH_TYPE &in)
|
||||||
in.fn=4;
|
in.fn=4;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 0, 1); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 0, 1); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
||||||
|
|
||||||
|
|
@ -240,12 +232,12 @@ void Square(MESH_TYPE &in)
|
||||||
in.fn=2;
|
in.fn=2;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
tp=MESH_TYPE::vectorial_type ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0, 1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (-1, 0, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType ( 0,-1, 0); tv.P()=tp; in.vert.push_back(tv);
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
||||||
|
|
||||||
|
|
@ -281,9 +273,9 @@ void Sphere(MESH_TYPE &in, const int subdiv = 3 )
|
||||||
/// r1 = raggio 1, r2 = raggio2, h = altezza (asse y)
|
/// r1 = raggio 1, r2 = raggio2, h = altezza (asse y)
|
||||||
template <class MESH_TYPE>
|
template <class MESH_TYPE>
|
||||||
void Cone( MESH_TYPE & in,
|
void Cone( MESH_TYPE & in,
|
||||||
const MESH_TYPE::scalar_type r1,
|
const typename MESH_TYPE::ScalarType r1,
|
||||||
const MESH_TYPE::scalar_type r2,
|
const typename MESH_TYPE::ScalarType r2,
|
||||||
const MESH_TYPE::scalar_type h )
|
const typename MESH_TYPE::ScalarType h )
|
||||||
{
|
{
|
||||||
const int D = 24;
|
const int D = 24;
|
||||||
int i,b1,b2;
|
int i,b1,b2;
|
||||||
|
|
@ -302,14 +294,14 @@ void Cone( MESH_TYPE & in,
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
|
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
|
|
||||||
tp=MESH_TYPE::vectorial_type ( 0,-h/2,0 );
|
tp=MESH_TYPE::CoordType ( 0,-h/2,0 );
|
||||||
tv.P()=tp;
|
tv.P()=tp;
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
|
|
||||||
tp=MESH_TYPE::vectorial_type ( 0, h/2,0 );
|
tp=MESH_TYPE::CoordType ( 0, h/2,0 );
|
||||||
tv.P()=tp;
|
tv.P()=tp;
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
|
|
||||||
|
|
@ -326,7 +318,7 @@ void Cone( MESH_TYPE & in,
|
||||||
x = r1*c;
|
x = r1*c;
|
||||||
z = r1*s;
|
z = r1*s;
|
||||||
y = -h/2;
|
y = -h/2;
|
||||||
tp=MESH_TYPE::vectorial_type ( x,y,z );
|
tp=MESH_TYPE::CoordType ( x,y,z );
|
||||||
tv.P()=tp;
|
tv.P()=tp;
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
}
|
}
|
||||||
|
|
@ -344,7 +336,7 @@ void Cone( MESH_TYPE & in,
|
||||||
x = r2*c;
|
x = r2*c;
|
||||||
z = r2*s;
|
z = r2*s;
|
||||||
y = h/2;
|
y = h/2;
|
||||||
tp=MESH_TYPE::vectorial_type ( x,y,z );
|
tp=MESH_TYPE::CoordType ( x,y,z );
|
||||||
tv.P()=tp;
|
tv.P()=tp;
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
}
|
}
|
||||||
|
|
@ -419,22 +411,22 @@ void Cone( MESH_TYPE & in,
|
||||||
|
|
||||||
|
|
||||||
template <class MESH_TYPE>
|
template <class MESH_TYPE>
|
||||||
void Box(MESH_TYPE &in, const MESH_TYPE::BOX_TYPE & bb )
|
void Box(MESH_TYPE &in, const typename MESH_TYPE::BoxType & bb )
|
||||||
{
|
{
|
||||||
in.vn=8;
|
in.vn=8;
|
||||||
in.fn=12;
|
in.fn=12;
|
||||||
in.vert.clear();
|
in.vert.clear();
|
||||||
in.face.clear();
|
in.face.clear();
|
||||||
MESH_TYPE::vertex_type tv;tv.Supervisor_Flags()=0;
|
MESH_TYPE::VertexType tv;tv.Supervisor_Flags()=0;
|
||||||
MESH_TYPE::vectorial_type tp;
|
MESH_TYPE::CoordType tp;
|
||||||
tp=MESH_TYPE::vectorial_type (bb.min[0],bb.min[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.min[0],bb.min[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.max[0],bb.min[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.max[0],bb.min[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.min[0],bb.max[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.min[0],bb.max[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.max[0],bb.max[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.max[0],bb.max[1],bb.min[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.min[0],bb.min[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.min[0],bb.min[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.max[0],bb.min[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.max[0],bb.min[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.min[0],bb.max[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.min[0],bb.max[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
tp=MESH_TYPE::vectorial_type (bb.max[0],bb.max[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
tp=MESH_TYPE::CoordType (bb.max[0],bb.max[1],bb.max[2]); tv.P()=tp; in.vert.push_back(tv);
|
||||||
|
|
||||||
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
vector<MESH_TYPE::vertex_pointer> index(in.vn);
|
||||||
|
|
||||||
|
|
@ -476,15 +468,15 @@ void Build( M & in, const V & v, const F & f)
|
||||||
|
|
||||||
V::const_iterator vi;
|
V::const_iterator vi;
|
||||||
|
|
||||||
M::vertex_type tv;
|
M::VertexType tv;
|
||||||
tv.Supervisor_Flags()=0;
|
tv.Supervisor_Flags()=0;
|
||||||
|
|
||||||
for(vi=v.begin();vi!=v.end();++vi)
|
for(vi=v.begin();vi!=v.end();++vi)
|
||||||
{
|
{
|
||||||
tv.P() = M::vectorial_type(
|
tv.P() = M::CoordType(
|
||||||
(M::scalar_type)(*vi).Ext(0),
|
(M::ScalarType)(*vi).Ext(0),
|
||||||
(M::scalar_type)(*vi).Ext(1),
|
(M::ScalarType)(*vi).Ext(1),
|
||||||
(M::scalar_type)(*vi).Ext(2)
|
(M::ScalarType)(*vi).Ext(2)
|
||||||
);
|
);
|
||||||
in.vert.push_back(tv);
|
in.vert.push_back(tv);
|
||||||
}
|
}
|
||||||
|
|
@ -515,4 +507,6 @@ void Build( M & in, const V & v, const F & f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // End Namespace TriMesh
|
||||||
|
} // End Namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue