PDEcone::PDEcone(const AcGePoint3d &ptStart, const AcGePoint3d &ptEnd, 
            double Diameter1, double Diameter2, const AcGeVector3d &vect, 
            int Precision/* = PRIMARY3D_DEFAULT_PRECISION*/, 
            bool HasSnap/* = false*/) : PDPrimary3D(HasSnap)
{
	m_ptStart = ptStart;
	m_ptEnd = ptEnd;
	
	if (m_ptStart.isEqualTo(m_ptEnd))
		m_ptEnd=m_ptStart+AcGeVector3d(0,0,1);

	m_dDiameter1 =fabs(Diameter1) ;
	if(m_dDiameter1==0)
		m_dDiameter1=1;
	m_dDiameter2 =fabs(Diameter2) ;
	
	m_vect = vect.normal();
    if(Precision > 2)
	    m_dDividPrecision = Precision;
    else
        m_dDividPrecision = PRIMARY3D_DEFAULT_PRECISION;

    CalActParameter();
#ifdef _USEAMODELER_
    createBody();
#endif
}//added by linlin 20050929
示例#2
0
void
ArxDbgDbEntity::getEcs(AcGeMatrix3d& retVal) const
{
    AcGeVector3d yDir = m_zDir.crossProduct(m_xDir);

    retVal.setCoordSystem(m_origin, m_xDir, yDir.normal(), m_zDir);
}
Acad::ErrorStatus PDEcone::setParameters(const AcGePoint3d &ptStart, 
                                         const AcGePoint3d &ptEnd, 
                                         double d1, 
                                         double d2, 
                                         const AcGeVector3d &vect, 
                                         int Precision/* = PRIMARY3D_DEFAULT_PRECISION*/)
{
	assertWriteEnabled();
	m_ptStart = ptStart;
	m_ptEnd = ptEnd;
   
	if(m_ptStart.isEqualTo(m_ptEnd))
		m_ptEnd=m_ptStart+AcGeVector3d(0,0,1);

	m_dDiameter1 =fabs(d1) ;
	if(m_dDiameter1==0)
		m_dDiameter1=1;
	m_dDiameter2 =fabs(d2) ;
	
	m_vect = vect.normal();
    if(Precision > 2)
	    m_dDividPrecision = Precision;
    else
        m_dDividPrecision = PRIMARY3D_DEFAULT_PRECISION;

	CalActParameter();

#ifdef _USEAMODELER_
    createBody();
#endif
	return Acad::eOk;
}//added by linlin 20050929