shun 发表于 2004-11-29 11:44:00

请朋友指点:为何自定义实体不能旋转?

由ACEdEntity派生自定义类,生成的实体,可能用move移动,但不能用rotate旋转,请朋友指点,是不是少重载了什么函数,或重载的哪个函数不正确?

funlxming 发表于 2004-11-29 22:12:00

自定义实体的编辑操作是要自已实现的.看看它的基类有哪些虚函数就知道了

shun 发表于 2004-11-30 08:23:00

基类中找不到有关旋转与移动实体的函数,我重载了以下函数,可以移动实体,但不可旋转实体.
        Adesk::Boolean worldDraw(AcGiWorldDraw* mode);
                                               
               Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
               Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
               Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
               Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
               Acad::ErrorStatus        transformBy       (const AcGeMatrix3d& xform);

pengst 发表于 2004-12-2 01:45:00

重载transformBy
还要看你的实体图形中是否有参数控制图形角度

shun 发表于 2004-12-2 10:07:00

谢谢pengst       提供帮助.我已重载了transformby()函数.
Acad::ErrorStatus AcDbWtext::transformBy(const AcGeMatrix3d& xform)
{
        assertWriteEnabled();
                       m_basepoint.transformBy(xform );
                       for(int i=0;i<5;i++){
                m_pVerts.transformBy(xform );
        }
                       return Acad::eOk;
}
我定制的实体是写文字,画多边形利用充填特性充色。
参数据如下:
private:
                       AcGePoint3d m_basepoint;//写字的起始点
        AcGeVector3d m_normal;//法向量(0,0,1)
                       char m_text;//文字
        double m_height;//字高
        double m_rotang;//字旋转角
        AcGePoint3d m_pVerts;//ploygon顶点

shun 发表于 2004-12-5 16:07:00

我的问题是否是问的不明确,怎么就没人能够帮助解决?
我的问题是自定义的实体,能够直接使用autocad的旋转(rotate)命令.但我没做通.
我重载了transformby().可以使用cad的move命令.但不能使用rotate命令.
        请会的朋友提供帮助!!!
谁有这方面的例子,请发一份,多谢了!!!
wanggoushun@163.com

shun 发表于 2004-12-6 15:26:00

问题基本决.可只能在0-180度范围内旋转
页: [1]
查看完整版本: 请朋友指点:为何自定义实体不能旋转?