minor changes
This commit is contained in:
parent
973c48fb76
commit
0a7cd4af5c
|
|
@ -46,7 +46,7 @@ namespace vcg
|
|||
enum DrawMode {DMUser,DMWire,DMSolid} ;
|
||||
private:
|
||||
|
||||
///used to find right trasformation in caso of rotation
|
||||
///used to find right trasformation in case of rotation
|
||||
static void XAxis( Point3d zero, Point3d uno, Matrix44d & tr){
|
||||
tr.SetZero();
|
||||
*((Point3d*)&tr[0][0]) = uno-zero;
|
||||
|
|
@ -302,6 +302,8 @@ namespace vcg
|
|||
template <DrawMode dm>
|
||||
static void glArrow(Point3d tail, Point3d head,double body_width,double head_lenght,
|
||||
double head_width,int body_slice=10,int head_slice=10,bool useDisplList=true)
|
||||
{
|
||||
if (tail!=head)
|
||||
{
|
||||
//assert(!glGetError());
|
||||
Matrix44d tr;
|
||||
|
|
@ -323,12 +325,15 @@ namespace vcg
|
|||
glPopAttrib();
|
||||
//assert(!glGetError());
|
||||
}
|
||||
}
|
||||
|
||||
/// draw a cone from tail to head
|
||||
/// width = width of the base of the cone
|
||||
/// slice = number of slices on the cone
|
||||
template <DrawMode dm>
|
||||
static void glCone(Point3d tail, Point3d head,double width,int slice=10,bool useDisplList=true)
|
||||
{
|
||||
if (tail!=head)
|
||||
{
|
||||
Matrix44d tr;
|
||||
XAxis(tail,head,tr);
|
||||
|
|
@ -343,12 +348,15 @@ namespace vcg
|
|||
glPopMatrix();
|
||||
glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
/// draw a cylinder from tail to head
|
||||
/// width = width of the base of the cylinder
|
||||
/// slice = number of slices on the cylinder
|
||||
template <DrawMode dm>
|
||||
static void glCylinder(Point3d tail, Point3d head,double width,int slice=10,bool useDisplList=true)
|
||||
{
|
||||
if (tail!=head)
|
||||
{
|
||||
Matrix44d tr;
|
||||
XAxis(tail,head,tr);
|
||||
|
|
@ -362,7 +370,7 @@ namespace vcg
|
|||
Cylinder(slice,l_body,width,useDisplList);
|
||||
glPopMatrix();
|
||||
glPopAttrib();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -373,6 +381,7 @@ namespace vcg
|
|||
template <DrawMode dm>
|
||||
static void glPoint(vcg::Point3f Center,float size,int slices =16,int stacks =16)
|
||||
{
|
||||
if (size!=0){
|
||||
glPushMatrix();
|
||||
glTranslate(Center);
|
||||
if (dm==DMWire)
|
||||
|
|
@ -384,6 +393,7 @@ namespace vcg
|
|||
glutSolidSphere(size,slices,stacks);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
/// draw a point in Center
|
||||
/// size = Radius of the point
|
||||
|
|
@ -392,6 +402,7 @@ namespace vcg
|
|||
template <DrawMode dm>
|
||||
static void glDiamond (Point3f Center, double size,bool useDisplList=true)
|
||||
{
|
||||
if (size!=0){
|
||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
SetGLParameters(dm);
|
||||
glPushMatrix();
|
||||
|
|
@ -400,6 +411,7 @@ namespace vcg
|
|||
glPopMatrix();
|
||||
glPopAttrib();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
Loading…
Reference in New Issue