Ejemplo n.º 1
0
ccQuadric::ccQuadric(	CCVector2 minCorner,
						CCVector2 maxCorner,
						const PointCoordinateType eq[6],
						const unsigned char* hfDims/*=0*/,
						const ccGLMatrix* transMat/*=0*/,
						QString name/*=QString("Plane")*/,
						unsigned precision/*=24*/)
	: ccGenericPrimitive(name,transMat)
	, m_minCorner(minCorner)
	, m_maxCorner(maxCorner)
	, m_minZ(0)
	, m_maxZ(0)
{
	memcpy(m_eq,eq,sizeof(PointCoordinateType)*6);
	if (hfDims)
	{
		memcpy(m_hfDims,hfDims,sizeof(unsigned char)*3);
	}
	else
	{
		m_hfDims[0] = 0;
		m_hfDims[1] = 1;
		m_hfDims[2] = 2;
	}
	
	setDrawingPrecision(std::max<unsigned>(precision,4));  //automatically calls buildUp + 	applyTransformationToVertices
}
Ejemplo n.º 2
0
ccQuadric::ccQuadric(	CCVector2 minCorner,
						CCVector2 maxCorner,
						const PointCoordinateType eq[6],
						const unsigned char* hfDims/*=0*/,
						const ccGLMatrix* transMat/*=0*/,
						QString name/*=QString("Plane")*/,
						unsigned precision/*=DEFAULT_DRAWING_PRECISION*/)
	: ccGenericPrimitive(name,transMat)
	, m_minCorner(minCorner)
	, m_maxCorner(maxCorner)
	, m_minZ(0)
	, m_maxZ(0)
{
	memcpy(m_eq,eq,sizeof(PointCoordinateType)*6);
	if (hfDims)
	{
		memcpy(m_hfDims,hfDims,sizeof(unsigned char)*3);
	}
	else
	{
		m_hfDims[0] = 0;
		m_hfDims[1] = 1;
		m_hfDims[2] = 2;
	}
	
	setDrawingPrecision(std::max<unsigned>(precision,MIN_DRAWING_PRECISION));  //automatically calls updateRepresentation
}
Ejemplo n.º 3
0
ccSphere::ccSphere(PointCoordinateType radius,
				   const ccGLMatrix* transMat/*=0*/,
				   QString name/*=QString("Sphere")*/,
				   unsigned precision/*=24*/)
	: ccGenericPrimitive(name,transMat)
	, m_radius(radius)
{
	setDrawingPrecision(std::max<unsigned>(precision,4));  //automatically calls buildUp + 	applyTransformationToVertices
}
Ejemplo n.º 4
0
ccDish::ccDish(	PointCoordinateType radius,
				PointCoordinateType height,
				PointCoordinateType radius2/*=0*/,
				const ccGLMatrix* transMat/*=0*/,
				QString name/*="Dish"*/,
				unsigned precision/*=DEFAULT_DRAWING_PRECISION*/)
	: ccGenericPrimitive(name,transMat)
	, m_baseRadius(radius)
	, m_secondRadius(radius2)
	, m_height(height)
{
	if (radius2 == 0)
		m_height = std::min(height,radius); //in spherical mode, the height can't be superior to the radius! (dishes are at most hemispheres)
	setDrawingPrecision(std::max<unsigned>(precision,MIN_DRAWING_PRECISION));  //automatically calls buildUp + 	applyTransformationToVertices
}
Ejemplo n.º 5
0
ccTorus::ccTorus(PointCoordinateType insideRadius,
				 PointCoordinateType outsideRadius,
				 double angle_rad/*=2.0*M_PI*/,
				 bool rectangularSection/*=false*/,
				 PointCoordinateType rectSectionHeight/*=0*/,
				 const ccGLMatrix* transMat/*=0*/,
				 QString name/*=QString("Torus")*/,
				 unsigned precision/*=24*/)
	: ccGenericPrimitive(name,transMat)
	, m_insideRadius(fabs(insideRadius))
	, m_outsideRadius(fabs(outsideRadius))
	, m_rectSection(rectangularSection)
	, m_rectSectionHeight(fabs(rectSectionHeight))
	, m_angle_rad(fabs(angle_rad))
{
	setDrawingPrecision(std::max<unsigned>(precision,4)); //automatically calls buildUp + 	applyTransformationToVertices
}
Ejemplo n.º 6
0
ccTorus::ccTorus(PointCoordinateType insideRadius,
				 PointCoordinateType outsideRadius,
				 double angle_rad/*=2.0*M_PI*/,
				 bool rectangularSection/*=false*/,
				 PointCoordinateType rectSectionHeight/*=0*/,
				 const ccGLMatrix* transMat/*=0*/,
				 QString name/*=QString("Torus")*/,
				 unsigned precision/*=DEFAULT_DRAWING_PRECISION*/)
	: ccGenericPrimitive(name,transMat)
	, m_insideRadius(fabs(insideRadius))
	, m_outsideRadius(fabs(outsideRadius))
	, m_rectSection(rectangularSection)
	, m_rectSectionHeight(fabs(rectSectionHeight))
	, m_angle_rad(fabs(angle_rad))
{
	setDrawingPrecision(std::max<unsigned>(precision,MIN_DRAWING_PRECISION)); //automatically calls updateRepresentation
}
Ejemplo n.º 7
0
ccCone::ccCone(PointCoordinateType bottomRadius,
				PointCoordinateType topRadius,
				PointCoordinateType height,
				PointCoordinateType xOff/*=0*/,
				PointCoordinateType yOff/*=0*/,
				const ccGLMatrix* transMat/*=0*/,
				QString name/*="Cylinder"*/,
				unsigned precision/*=DEFAULT_DRAWING_PRECISION*/)
	: ccGenericPrimitive(name,transMat)
	, m_bottomRadius(fabs(bottomRadius))
	, m_topRadius(fabs(topRadius))
	, m_xOff(xOff)
	, m_yOff(yOff)
	, m_height(fabs(height))
{
	setDrawingPrecision(std::max<unsigned>(precision,MIN_DRAWING_PRECISION)); //automatically calls buildUp & applyTransformationToVertices
}