• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ calculateBorders函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中calculateBorders函数的典型用法代码示例。如果您正苦于以下问题:C++ calculateBorders函数的具体用法?C++ calculateBorders怎么用?C++ calculateBorders使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了calculateBorders函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: angleVector

//rotation
void RS_Solid::rotate(const RS_Vector& center, const double& angle) {
    RS_Vector angleVector(angle);
    for (int i=0; i<4; ++i) {
        data.corner[i].rotate(center, angleVector);
    }
    calculateBorders();
}
开发者ID:JGabriel85,项目名称:LibreCAD,代码行数:8,代码来源:rs_solid.cpp


示例2: data

/**
 * Constructor.
 * @param d Polyline data
 */
RS_Polyline::RS_Polyline(RS_EntityContainer* parent,
                         const RS_PolylineData& d)
        :RS_EntityContainer(parent), data(d) {

    closingEntity = NULL;
    calculateBorders();
}
开发者ID:Seablade,项目名称:vec2web,代码行数:11,代码来源:rs_polyline.cpp


示例3: RS_Dimension

/**
 * Constructor.
 *
 * @para parent Parent Entity Container.
 * @para d Common dimension geometrical data.
 * @para ed Extended geometrical data for angular dimension.
 */
RS_DimAngular::RS_DimAngular(RS_EntityContainer* parent,
                             const RS_DimensionData& d,
                             const RS_DimAngularData& ed)
        : RS_Dimension(parent, d), edata(ed) {

    calculateBorders();
}
开发者ID:JGabriel85,项目名称:LibreCAD,代码行数:14,代码来源:rs_dimangular.cpp


示例4: calculateBorders

/**
 * Removes an entity from this container and updates the borders of 
 * this entity-container if autoUpdateBorders is true.
 */
bool RS_EntityContainer::removeEntity(RS_Entity* entity) {
    bool ret = entities.remove(entity);
    if (autoUpdateBorders) {
        calculateBorders();
    }
    return ret;
}
开发者ID:Seablade,项目名称:vec2web,代码行数:11,代码来源:rs_entitycontainer.cpp


示例5: data

/**
 * Constructor.
 */
RS_Ellipse::RS_Ellipse(RS_EntityContainer* parent,
                       const RS_EllipseData& d)
        :RS_AtomicEntity(parent), data(d) {

    //calculateEndpoints();
    calculateBorders();
}
开发者ID:Seablade,项目名称:vec2web,代码行数:10,代码来源:rs_ellipse.cpp


示例6: RS_Dimension

/**
 * Constructor.
 *
 * @para parent Parent Entity Container.
 * @para d Common dimension geometrical data.
 * @para ed Extended geometrical data for diametric dimension.
 */
RS_DimDiametric::RS_DimDiametric(RS_EntityContainer* parent,
                           const RS_DimensionData& d,
                           const RS_DimDiametricData& ed)
        : RS_Dimension(parent, d), edata(ed) {

    calculateBorders();
}
开发者ID:Aly1029,项目名称:LibreCAD,代码行数:14,代码来源:rs_dimdiametric.cpp


示例7: getEllipseAngle

void RS_Ellipse::moveEndpoint(const RS_Vector& pos) {
    data.angle2 = getEllipseAngle(pos);
    //data.angle2 = data.center.angleTo(pos);
    //calculateEndpoints();
    correctAngles(); // make sure angleLength is no more than 2*M_PI
    calculateBorders();
}
开发者ID:beginner1,项目名称:LibreCAD,代码行数:7,代码来源:rs_ellipse.cpp


示例8: removeEntity

/**
 * Implementation of update. Updates the arrow.
 */
void RS_Leader::update() {

    // find and delete arrow:
	for(auto e: entities){
        if (e->rtti()==RS2::EntitySolid) {
            removeEntity(e);
            break;
        }
    }

        if (isUndone()) {
                return;
        }

    RS_Entity* fe = firstEntity();
    if (fe && fe->isAtomic()) {
        RS_Vector p1 = ((RS_AtomicEntity*)fe)->getStartpoint();
        RS_Vector p2 = ((RS_AtomicEntity*)fe)->getEndpoint();

        // first entity must be the line which gets the arrow:
        if (hasArrowHead()) {
            RS_Solid* s = new RS_Solid(this, RS_SolidData());
            s->shapeArrow(p1,
                          p2.angleTo(p1),
                          getGraphicVariableDouble("$DIMASZ", 2.5)* getGraphicVariableDouble("$DIMSCALE", 1.0));
            s->setPen(RS_Pen(RS2::FlagInvalid));
			s->setLayer(nullptr);
            RS_EntityContainer::addEntity(s);
        }
    }
    calculateBorders();
}
开发者ID:Azen2011,项目名称:LibreCAD,代码行数:35,代码来源:rs_leader.cpp


示例9: data

/**
 * Constructor.
 */
RS_Image::RS_Image(RS_EntityContainer* parent,
                   const RS_ImageData& d)
        :RS_AtomicEntity(parent), data(d) {

    update();
    calculateBorders();
}
开发者ID:rmamba,项目名称:LibreCAD,代码行数:10,代码来源:rs_image.cpp


示例10: RS_Dimension

/**
 * Constructor.
 *
 * @para parent Parent Entity Container.
 * @para d Common dimension geometrical data.
 * @para ed Extended geometrical data for aligned dimension.
 */
RS_DimAligned::RS_DimAligned(RS_EntityContainer* parent,
                             const RS_DimensionData& d,
                             const RS_DimAlignedData& ed)
        : RS_Dimension(parent, d), edata(ed) {

    calculateBorders();
}
开发者ID:Rupicapra-rupicapra,项目名称:LibreCAD,代码行数:14,代码来源:rs_dimaligned.cpp


示例11: angleVector

void RS_Image::rotate(const RS_Vector& center, const double& angle) {
    RS_Vector angleVector(angle);
    data.insertionPoint.rotate(center, angleVector);
    data.uVector.rotate(angleVector);
    data.vVector.rotate(angleVector);
    calculateBorders();
}
开发者ID:rmamba,项目名称:LibreCAD,代码行数:7,代码来源:rs_image.cpp


示例12: update

void RS_Image::updateData(RS_Vector size, RS_Vector Uv, RS_Vector Vv) {
    data.size = size;
    data.uVector = Uv;
    data.vVector = Vv;
    update();
    calculateBorders();
}
开发者ID:rmamba,项目名称:LibreCAD,代码行数:7,代码来源:rs_image.cpp


示例13: data

/**
 * Constructor.
 */
RS_Line::RS_Line(RS_EntityContainer* parent,
                 const RS_LineData& d)
    :RS_AtomicEntity(parent), data(d), division(1), point_set(false)
{
  calculateBorders();
  initLabel();
}
开发者ID:Akaur,项目名称:qdraw,代码行数:10,代码来源:rs_line.cpp


示例14: atan

/**
 * Creates an arc from its startpoint, endpoint and bulge.
 */
bool RS_Arc::createFrom2PBulge(const RS_Vector& startPoint, const RS_Vector& endPoint,
                               double bulge) {
    data.reversed = (bulge<0.0);
    double alpha = atan(bulge)*4.0;

    RS_Vector middle = (startPoint+endPoint)/2.0;
    double dist = startPoint.distanceTo(endPoint)/2.0;

    // alpha can't be 0.0 at this point
    data.radius = fabs(dist / sin(alpha/2.0));

    double wu = fabs(RS_Math::pow(data.radius, 2.0) - RS_Math::pow(dist, 2.0));
    double h = sqrt(wu);
    double angle = startPoint.angleTo(endPoint);

    if (bulge>0.0) {
        angle+=M_PI/2.0;
    } else {
        angle-=M_PI/2.0;
    }

    if (fabs(alpha)>M_PI) {
        h*=-1.0;
    }

    data.center.setPolar(h, angle);
    data.center+=middle;
    data.angle1 = data.center.angleTo(startPoint);
    data.angle2 = data.center.angleTo(endPoint);

    calculateEndpoints();
    calculateBorders();

	return true;
}
开发者ID:Seablade,项目名称:vec2web,代码行数:38,代码来源:rs_arc.cpp


示例15: vp

/* Dongxu Li's Version, 19 Aug 2011
 * scale an ellipse
 * Find the eigen vactors and eigen values by optimization
 * original ellipse equation,
 * x= a cos t
 * y= b sin t
 * rotated by angle,
 *
 * x = a cos t cos (angle) - b sin t sin(angle)
 * y = a cos t sin (angle) + b sin t cos(angle)
 * scaled by ( kx, ky),
 * x *= kx
 * y *= ky
 * find the maximum and minimum of x^2 + y^2,
 */
void RS_Ellipse::scale(RS_Vector center, RS_Vector factor) {
    data.center.scale(center, factor);
    RS_Vector vpStart=getStartpoint().scale(getCenter(),factor);
    RS_Vector vpEnd=getEndpoint().scale(getCenter(),factor);;
    double ct=cos(getAngle());
    double ct2 = ct*ct; // cos^2 angle
    double st=sin(getAngle());
    double st2=1.0 - ct2; // sin^2 angle
    double kx2= factor.x * factor.x;
    double ky2= factor.y * factor.y;
    double a=getMajorRadius();
    double b=getMinorRadius();
    double cA=0.5*a*a*(kx2*ct2+ky2*st2);
    double cB=0.5*b*b*(kx2*st2+ky2*ct2);
    double cC=a*b*ct*st*(ky2-kx2);
    RS_Vector vp(cA-cB,cC);
    setMajorP(RS_Vector(a,b).scale(RS_Vector(vp.angle())).rotate(RS_Vector(ct,st)).scale(factor));
    a=cA+cB;
    b=vp.magnitude();
    setRatio( sqrt((a - b)/(a + b) ));
    if(   std::isnormal(getAngle1()) || std::isnormal(getAngle2() ) )  {
        //only reset start/end points for ellipse arcs, i.e., angle1 angle2 are not both zero
        setAngle1(getEllipseAngle(vpStart));
        setAngle2(getEllipseAngle(vpEnd));
    }
    correctAngles();//avoid extra 2.*M_PI in angles
    //calculateEndpoints();
    calculateBorders();
}
开发者ID:beginner1,项目名称:LibreCAD,代码行数:44,代码来源:rs_ellipse.cpp


示例16: calculateEndpoints

/**
 * Creates an arc from its startpoint, endpoint, start direction (angle)
 * and radius.
 * 
 * @retval true Successfully created arc
 * @retval false Cannot creats arc (radius to small or endpoint to far away)
 */
bool RS_Arc::createFrom2PDirectionRadius(const RS_Vector& startPoint,
        const RS_Vector& endPoint,
        double direction1, double radius) {

    RS_Vector ortho;
    ortho.setPolar(radius, direction1 + M_PI/2.0);
    RS_Vector center1 = startPoint + ortho;
    RS_Vector center2 = startPoint - ortho;

    if (center1.distanceTo(endPoint) < center2.distanceTo(endPoint)) {
        data.center = center1;
    } else {
        data.center = center2;
    }

    data.radius = radius;
    data.angle1 = data.center.angleTo(startPoint);
    data.angle2 = data.center.angleTo(endPoint);
    data.reversed = false;

    double diff = RS_Math::correctAngle(getDirection1()-direction1);
    if (fabs(diff-M_PI)<1.0e-1) {
        data.reversed = true;
    }

    calculateEndpoints();
    calculateBorders();

    return true;
}
开发者ID:Seablade,项目名称:vec2web,代码行数:37,代码来源:rs_arc.cpp


示例17: RS_AtomicEntity

/**
 * Default constructor.
 */
RS_Solid::RS_Solid(RS_EntityContainer* parent,
                   const RS_SolidData& d) :
    RS_AtomicEntity(parent),
    data(d)
{
    calculateBorders();
}
开发者ID:LibreCAD,项目名称:LibreCAD,代码行数:10,代码来源:rs_solid.cpp


示例18: vp0

void RS_Image::mirror(const RS_Vector& axisPoint1, const RS_Vector& axisPoint2) {
    data.insertionPoint.mirror(axisPoint1, axisPoint2);
    RS_Vector vp0(0.,0.);
    RS_Vector vp1( axisPoint2-axisPoint1 );
    data.uVector.mirror(vp0,vp1);
    data.vVector.mirror(vp0,vp1);
    calculateBorders();
}
开发者ID:PlastecProfiles,项目名称:LibreCAD,代码行数:8,代码来源:rs_image.cpp


示例19: calculateBorders

/**
 * Constructor.
 * @param d Polyline data
 */
RS_Polyline::RS_Polyline(RS_EntityContainer* parent,
                         const RS_PolylineData& d)
		:RS_EntityContainer(parent, true)
		,data(d)
		,closingEntity(nullptr)
		,nextBulge(0.)
{
	calculateBorders();
}
开发者ID:CERobertson,项目名称:LibreCAD,代码行数:13,代码来源:rs_polyline.cpp


示例20: calculateBorders

void RS_EntityContainer::rotate(const RS_Vector& center, const RS_Vector& angleVector) {

	for(auto e: entities){
        e->rotate(center, angleVector);
    }
    if (autoUpdateBorders) {
        calculateBorders();
    }
}
开发者ID:Rupicapra-rupicapra,项目名称:LibreCAD,代码行数:9,代码来源:rs_entitycontainer.cpp



注:本文中的calculateBorders函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ calculateChecksum函数代码示例发布时间:2022-05-30
下一篇:
C++ calcoffset函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap