zoukankan      html  css  js  c++  java
  • OpenCASCADE 基础

    OpenCASCADE 基础

    转载

    一直在用OCC作项目,但这方面的中文资料很少,看来OCC在中国还不是十分普及;

    后来,项目中使用OCC和DirectX结合使用,取得了很好的效果;

    随着OCC6.3版本的推出,Open CASCADE在速度方面已有了很大的改变。以下为一些OCC的基础知识,愿与各位OCC爱好者共同学习;

    一:OCC中的基础类:

    gp_Pnt

    在OCC中,gp_Pnt表示一个顶点,gp_Vec表示一个向量,可以用两个顶点来生成一个向量。

    比如:

    gp_Pnt P1(0,0,0); 

    gp_Pnt P2(5,0,0); 

    gp_Vec V1 (P1,P2);

    向量有一个方法.IsOpposite(),可以用来测试两个向量的方向是相对还是平行;

    比如: 

    gp_Pnt P3(-5,0,2);

    gp_Vec V2 (P1,P3); 

    Standard_Boolean result =V1.IsOpposite(V2,Precision::Angular());

    另外向量还有一些重要方法:

    --Standard_Real Magnitude() const;计算向量的大小;

    --Standard_Real SquareMagnitude() const;计算向量的平方;

    --向量的加减乘除操作;

    --向量的单位化;

    --通过一个点,线,面得出其镜像的向量;

    --向量的旋转,平移,缩放;

    具体的函数名称可以看OCC的头文件说明;

    有时需要决定一组空间点是位于一个点;一条直线,或一个平面,或一个空间:

    OCC中提供了相应的算法;

    比如:

    TColgp_Array1OfPnt array (1,5); // sizing array 

    array.SetValue(1,gp_Pnt(0,0,1)); 

    array.SetValue(2,gp_Pnt(1,2,2)); 

    array.SetValue(3,gp_Pnt(2,3,3)); 

    array.SetValue(4,gp_Pnt(4,4,4)); 

    array.SetValue(5,gp_Pnt(5,5,5)); 

    GProp_PEquation PE (array,1.5 ); 

    if (PE.IsPoint()){   } //是否是同一个点 

    gp_Lin L; 

    if (PE.IsLinear()) {  L = PE.Line();  } //是否位于一条直线上; 

    if (PE.IsPlanar()){   }  //是否在一个平面内; 

    if (PE.IsSpace()) {   } 

    gp_Dir类:

    此类用来描述3D空间中的一个单位向量;

    常用方法:

    (1):IsEqual(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量是否相等;

    (2):IsNormal(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量的夹角是否是PI/2;

    (3):IsOpposite(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量是否方向相反;

    (4):IsParallel(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量夹角O或PI;

    (5):Angle(const gp_Dir& Other) const;求两个向量之间的夹角;

    (6):void CrossCross(const gp_Dir& V1,const gp_Dir& V2) ;计算三个向量之间的叉积;

    (7):Standard_Real Dot(const gp_Dir& Other) const;计算点积;

    (8):Standard_Real DotCross(const gp_Dir& V1,const gp_Dir& V2) const;计算叉积再点积;

    (9):gp_Dir Reversed() const;得到反方向,

    在OCC中用 gp_Lin2d 类,来生成一个二维空间的直线,有它的原点和单位向量;

    gp_Ax2d类:

    通过原点和X方向单位和Y方向单位建立一个二维坐标系;利用sense参数可以决定是右手系还是左手系;

    可以利用平移、旋转、缩放、镜像来更改坐标系;

    类似地,gp_Ax3类:

    用来描述一个3D空间的坐标系。而gp_Ax2类用来表示一个二维空间坐标系;可以为右手系,也可以是左手系;

    二、曲线类

    GeomAPIGeomConvert包:

    GeomAPI开发包提供了一个几何体的可编程应用程序接口;

    比如:

    求点P和曲线C的距离D:

    D = GeomAPI_ProjectPointOnCurve(P,C);

    或者

    GeomAPI_ProjectPointOnCurve PonC(P,C);

    D = PonC.LowerDistance();

    GeomConvert包提供了一些全局函数,可以用来实现转化一个Geom曲线为BSpline曲线等;

    比如:

    Handle(Geom_BSplineSurface) aPipeSurface = 

    Handle(Geom_BSplineSurface)::DownCast(aPipe.Surface()); 

    Handle(Geom_BSplineSurface) anotherBSplineSurface = 

    GeomConvert::SplitBSplineSurface(aPipeSurface,1,2,3,6);

    OCC中三维几何曲线的类型有:

    --线

    --园

    --椭圆

    --二次曲线

    --抛物线

    --Bezier曲线

    --BSpline曲线

    可以将一个二维的几何曲线转化为某个平面内的一个三维曲线:

    比如:

    Standard_Real radius = 5; 

    gp_Ax2d ax2d(gp_Pnt2d(2,3),gp_Dir2d(1,0)); 

    //生成一个二维园 

    Handle(Geom2d_Circle) circ2d = new Geom2d_Circle(ax2d,radius); 

    gp_Ax2d circ2dXAxis = circ2d->XAxis(); 

    // 然后,在这个平面里转化为三维曲线; 

    Handle(Geom_Curve) C3D = GeomAPI::To3d(circ2d,gp_Pln(gp_Ax3(gp::XOY()))); 

    Handle(Geom_Circle) C3DCircle = Handle(Geom_Circle)::DownCast(C3D); 

    gp_Ax1 C3DCircleXAxis = C3DCircle->XAxis(); 

    另外,可以以将一个三维曲线,投影到一个平面内,从而生成一个二维曲线

    gp_Pln ProjectionPlane(gp_Pnt(1,1,0),gp_Dir( 1,1,1 )); 

    Handle(Geom2d_Curve) C2D = GeomAPI::To2d(C3D,ProjectionPlane); 

    Handle(Geom2d_Circle) C2DCircle =Handle(Geom2d_Circle)::DownCast(C2D); 

    gp_Ax2d C2DCircleXAxis = C2DCircle->XAxis();

    将一个基本几何图形进行空间变换可以使用它自带的函数:

    比如:

    Handle(Geom_Geometry) aRotatedEntity  = circle->Rotated(gp::OZ(),PI/4);

    如果想获取图形的类型名称: 

    Standard_CString aRotatedEntityTypeName = aRotatedEntity->DynamicType()->Name();

    gp_Parab2d类:

    描述一个平面内的抛物线;

    示例:

    gp_Pnt2d P(2,3); 

    gp_Dir2d D(4,5); 

    gp_Ax22d A(P,D); 

    gp_Parab2d Para(A,6);

    GCE2d_MakeParabola类:

    生成一个抛物线图形;

    Geom2d_BSplineCurve类:

    描述样条曲线;

    Geom2dAPI_Interpolate类:

    通过一组点来修改一个样条曲线;

    FairCurve_Batten类:

    用一个常量或线性增加的值来构造曲线;可以用来设计木纹或塑料板条;图形为二维的,可以模拟物理样条或板条.

    Geom2d_TrimmedCurve类:

    此类通过两个值,定义曲线的一部分,

    --可以用来计算曲线的参数值和点坐标;

    --可以得到曲线的一般特征,比如连续的等级,封闭特点,周期性,边界参数;

    --当用一个矩阵应用于曲线或原始曲线转化后进行相应参数的改变;

    所有的曲线必须几何连续,曲线至少一阶可导。一般来说,在生成一个曲线时,要先检查一下所应用的参数是否可以生成一个光滑曲线;否则会出现错误;

    另外注意一点:不可以构造空长度的曲线或自相交的曲线;

    此类的基类是Geom2d_BoundedCurve类:

    它是一个抽象类;描述二维空间中的边界曲线的一般行为;除了Geom2d_TrimmedCurve是它的一个派生类外,它还有二个派生类:

    - Geom2d_BezierCurve

    - Geom2d_BSplineCurve

    Geom2d_BoundedCurve类的基类是Geom2d_Curve类:

    Geom2d_Curve:抽象类;此抽象类描述了2D空间的曲线的一般特征;派生出的类有多个:包括直线,园,二次曲线,Bizier,BSpline曲线等;这些曲线的特点是可以参数化;

    Geom2d_Curve类的基类是Geom2d_Geometry类;

    此抽象类主要定义了曲线的变换,平移,旋转,缩放及拷贝等方法;

    Geom2d_Geometry类的基类是MMgt_TShared类;

    此抽象类为管理对象的基类,可以引用计数,及删除方法;

    Standard_Transient:此抽象类为所有类共同的基类;

    Geom2dAPI_InterCurveCurve类:

    此类用来实现二维曲线的相交;

    一种情况是曲线与曲线的相交,另外一种情况是曲线自身的相交;

    主要方法有:

    --Standard_Integer NbPoints() const;相交点数;

    --Standard_Integer NbSegments() const;切线相交数;

    --void Segment(const Standard_Integer Index,Handle(Geom2d_Curve)& Curve1,Handle(Geom2d_Curve)& Curve2)

    const;返回其中一个线段;

    下面的示例是两个曲线相交的例子:

    首先,生成第一个曲线,在这里,应用点数组来生成一个曲线;

    --定义数组

    Handle(TColgp_HArray1OfPnt2d) harray =  new TColgp_HArray1OfPnt2d (1,5); // sizing harray 

    --输入点数组的值

    harray->SetValue(1,gp_Pnt2d (0,0)); 

    harray->SetValue(2,gp_Pnt2d (-3,1)); 

    harray->SetValue(3,gp_Pnt2d (-2,5)); 

    harray->SetValue(4,gp_Pnt2d (2,9)); 

    harray->SetValue(5,gp_Pnt2d (-4,14)); 

    --检测一下点与点之间是否为同一点;0.01为公差值,依实际需要可以更改此参数; 

    Geom2dAPI_Interpolate anInterpolation(harray,Standard_False,0.01); 

    --生成曲线

    anInterpolation.Perform(); 

    Handle(Geom2d_BSplineCurve) SPL = anInterpolation.Curve(); 

    --第二个曲线用两点来生成 

    gp_Pnt2d P1(-1,-2);gp_Pnt2d P2(0,15);gp_Dir2d V1 = gp::DY2d(); 

    Handle(Geom2d_TrimmedCurve) TC1=  GCE2d_MakeSegment(P1,V1,P2); 

    --下面进行曲线的求交 

    Standard_Real tolerance = Precision::Confusion(); 

    Geom2dAPI_InterCurveCurve ICC (SPL,TC1,tolerance); 

    --得到交点 

    Standard_Integer NbPoints =ICC.NbPoints(); 

    gp_Pnt2d PK; 

    for (Standard_Integer k = 1;k<=NbPoints;k++) 

    {

    PK = ICC.Point(k); 

    // 针对每个交点,进行相应处理; 

    Geom2d_OffsetCurve类:

    此类用来实现偏移曲线;

    比如:

    --生成一个曲线

    TColgp_Array1OfPnt2d array (1,5); // sizing array 

    array.SetValue(1,gp_Pnt2d (-4,0)); array.SetValue(2,gp_Pnt2d (-7,2)); 

    array.SetValue(3,gp_Pnt2d (-6,3)); array.SetValue(4,gp_Pnt2d (-4,3)); 

    array.SetValue(5,gp_Pnt2d (-3,5)); 

    Handle(Geom2d_BSplineCurve) SPL1 = Geom2dAPI_PointsToBSpline(array); 

    --生成一个偏移曲线 

    Standard_Real dist = 1; 

    Handle(Geom2d_OffsetCurve) OC = 

    new Geom2d_OffsetCurve(SPL1,dist); 

    Standard_Boolean result = OC->IsCN(2); 

    GccAna_Pnt2dBisec类

    此类实现两点之间的等分线.

    示例:

    gp_Pnt2d P1(1,2); 

    gp_Pnt2d P2(4,5); 

    gp_Lin2d L; 

    GccAna_Pnt2dBisec B(P1,P2); 

    if (B.IsDone()) 

    { L = B.ThisSolution(); }

    因为所生成的为直线,所以显示时要转化为线段:

    if (B.IsDone())

    {

    Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-8,8);

    Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aLine);

    aDoc->GetISessionContext()->Display(aCurve, Standard_False);

    }

    gce_MakeCirc2d类

    用来创建园:创建园的方法很多,主要构造方法有:

    --园心和通过的一点;

    --通过一个园和一个距离值,创建一个同心园;

    --三点决定一个园;

    --园心和半径;

    gp_Elips2d类:

    可以生成一个椭园,也可以生成椭园上的一段园弧;

    比如:

    Standard_Real major = 12; 

    Standard_Real minor = 4; 

    gp_Ax2d axis = gp::OX2d(); 

    gp_Elips2d EE(axis,major,minor);; 

    Handle(Geom2d_TrimmedCurve) arc = GCE2d_MakeArcOfEllipse(EE,0.0,PI/4);
    上面是利用长短轴的方法构造椭圆,也可以用二次方程的方式来构造椭园;

    其中椭园类中方法可以求出焦点1和焦点2的位置,两焦点之间的位置,离心率;旋转,平移,缩放等操作.

    三、关于面的类

    gp_Pln:

    定义一个平面,构造的方法可以是点法式,或通过ABCD系数;

    另外,还提供了一些常用的方法,比如:

    --求点到平面,线到平面,平面与平面的距离及平方距离;

    --点是否在平面内,线是否在平面内;

    --通过一个点,一个轴的镜像平面;

    --平面的旋转,缩放与平移;

    Geom_ElementarySurface类:

    此类用来描述一个表面,此类的派生类有:

    平面;园柱面;锥面;球面;园环面;

    它的基类是Geom_Surface,是一个抽象类;

    Geom_Surface类的基类是Geom_Geometry类;

    Geom_RectangularTrimmedSurface类:

    用来生成一个有边界的平面;

    比如:

    Handle(Geom_Plane) aProjectionPlane = GC_MakePlane(ProjectionPlane).Value();

    Handle(Geom_RectangularTrimmedSurface) aProjectionPlaneSurface=

    new Geom_RectangularTrimmedSurface(aProjectionPlane,-8.,8.,-12.,12.); 

    DisplaySurface(aDoc,aProjectionPlaneSurface);

    此类的基类是Geom_BoundedSurface类;

    此类的兄弟类还有

    - Geom_BezierSurface,

    - Geom_BSplineSurface

    ConicalSurface类:用来创建一个园锥表面;

    构造表面的方法有:

    --已知一个园锥表面,和空间一点,过此点的平行于已知园锥表面;

    --已知一个园锥表面,和一个距离,创建一个平行于已知园锥表面的园锥表面;

    --通过四个点构造一个园锥表面;

    --通过一个轴和两个点;

    --通过两个点和两个半径;

    GeomAPI_IntCS类:

    此类用来计算一个园弧和和一个表面的交点或相交线段;

    GeomFill_BSplineCurves类:

    此类用来构造一个可以填充的BSpline表面,构造它可以用两个三个或四个BSpline曲线作为边界;

    填充类型有三种:

    enum GeomFill_FillingStyle {

    GeomFill_StretchStyle,

    GeomFill_CoonsStyle,

    GeomFill_CurvedStyle

    };

    以下示例为用两个样条曲线生成一个表面:

    GeomFill_FillingStyle Type = GeomFill_StretchStyle; 

    GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); 

    Handle(Geom_BSplineSurface)  aBSplineSurface1 = aGeomFill1.Surface();

    GeomFill_Pipe类:

    此类用来构造一个pipe,沿着一个路径sweep一个截面,这两个都是曲线类型;一般来说,结果是一个BSpline表面;

    常见的有几种方法:

    --给定一个路径和一个半径,截面是个园,位置是路径的第一个点,

    比如:

    GeomFill_Pipe aPipe(SPL1,1); 

    aPipe.Perform(); 

    Handle(Geom_Surface) aSurface= aPipe.Surface(); 

    Standard_CString aSurfaceEntityTypeName="Not Computed"; 

    if (!aSurface.IsNull()) 

    aSurfaceEntityTypeName = aSurface->DynamicType()->Name();

    --给定一个路径和一个截面。

    比如:

    Handle(Geom_Ellipse) E = GC_MakeEllipse( gp::XOY() ,3,1).Value(); 

    GeomFill_Pipe aPipe2(SPL1,E); 

    aPipe2.Perform(); 

    Handle(Geom_Surface) aSurface2= aPipe2.Surface(); 

    Standard_CString aSurfaceEntityTypeName2="Not Computed"; 

    if (!aSurface2.IsNull())  { 

    aSurfaceEntityTypeName2 = aSurface2->DynamicType()->Name(); 

    aSurface2->Translate(gp_Vec(5,0,0));  }

    --给定一个路径和两个截面,中间截面为过度线;

    示例:

    Handle(Geom_TrimmedCurve) TC1 = 

    GC_MakeSegment(gp_Pnt(1,1,1),gp_Pnt(5,5,5)); 

    Handle(Geom_TrimmedCurve) TC2 = 

    GC_MakeSegment(gp_Pnt(1,1,0),gp_Pnt(4,5,6)); 

    GeomFill_Pipe aPipe3(SPL1,TC1,TC2); 

    aPipe3.Perform(); 

    Handle(Geom_Surface) aSurface3 = aPipe3.Surface(); 

    Standard_CString aSurfaceEntityTypeName3="Not Computed"; 

    if (!aSurface3.IsNull()) 

    aSurfaceEntityTypeName3 = aSurface3->DynamicType()->Name(); 

    aSurface3->Translate(gp_Vec(10,0,0)); 

    --给定一个路径和N个截面,中间为过渡线;

    一般情况下,所生结果为:NURBS,但是,在一些特殊的情况下,可以生成平面,园柱,球,园锥等;

    参数,U,沿着截面的方向,V沿着路径方向;

    Geom_BezierSurface类:

    生成一个Bezier表面;

    Geom_OffsetSurface类:

    用来偏移一个表面;

    比如:

    Standard_Real offset = 1; 

    Handle(Geom_OffsetSurface) GOS = new Geom_OffsetSurface(aGeomSurface, offset);

    Geom_SweptSurface类:

    有两个派生类,分别用来生成一个回转体表面和一个延展体表面;

    Geom_SurfaceOfLinearExtrusion:用来描述一个线性延展表面;

    它的基类是:Geom_Surface类

    比如:

    Handle(Geom_BSplineCurve) aCurve =GeomAPI_PointsToBSpline(array).Curve(); 

    gp_Dir aDir(1,2,3); 

    Handle(Geom_SurfaceOfLinearExtrusion) SOLE =new Geom_SurfaceOfLinearExtrusion(aCurve,aDir); 

    Handle(Geom_RectangularTrimmedSurface) aTrimmedSurface =new Geom_RectangularTrimmedSurface(SOLE,-10,10,false);

    Geom_SurfaceOfRevolution类,表示一个回转体表面;

    比如:

    Handle(Geom_BSplineCurve) aCurve = GeomAPI_PointsToBSpline(array).Curve(); 

    Handle(Geom_SurfaceOfRevolution) SOR =new Geom_SurfaceOfRevolution(aCurve,gp::OX()); 

    1:利用一个二维数组来生成曲面的方法:

    TColgp_Array2OfPnt array3 (1,5,1,5); 

    array3.SetValue(1,1,gp_Pnt (-4,-4,5));

    ...

    array3.SetValue(2,1,gp_Pnt (-2,-4,4));

    ...

    Handle(Geom_BSplineSurface) aSurf2 =GeomAPI_PointsToBSplineSurface(array3).Surface();

    2:GeomAPI_ExtremaSurfaceSurface类:

    计算两个表面之间的极值点;

    主要方法:

    (1):Quantity_Length LowerDistance() const;计算两个表面的最短距离;

    (2):Standard_EXPORT  void LowerDistanceParameters(Quantity_Parameter& U1,Quantity_Parameter& V1,Quantity_Parameter& U2,Quantity_Parameter& V2) const;

    得到第一个表面上的极值点的UV参数和第二个表面上的极值点的UV参数;

    (3):void NearestPoints(gp_Pnt& P1,gp_Pnt& P2) const;得到第一个表面上的极值点和第二个表面上的极值点;

    (4): Quantity_Length Distance(const Standard_Integer Index) const;得到第N个极值点的距离;

    (5):Standard_Integer NbExtrema() const;极值的数目;

    ......

    示例:

    GeomAPI_ExtremaSurfaceSurface ESS(aSurf1,aSurf2);

    Quantity_Length dist = ESS.LowerDistance();

    gp_Pnt P1,P2;

    ESS.NearestPoints(P1,P2);

    gp_Pnt P3,P4;

    Handle(Geom_Curve) aCurve;

    Standard_Integer NbExtrema = ESS.NbExtrema();

    for(Standard_Integer k=1;k<=NbExtrema;k++){

    ESS.Points(k,P3,P4); 

    aCurve= GC_MakeSegment(P3,P4).Value();

    DisplayCurve(aDoc,aCurve,Quantity_NOC_YELLOW3,false);

    }

    一些OCC的基础知识,愿与各位OCC爱好者共同学习;mail:tongabcd@yeah.net

    一:关于体的类

    BRepBuilderAPI_MakeVertex

    创建点;

    BRepBuilderAPI_MakeEdge

    此类用来创建边;

    比如,由直线生成边:

    gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0)));

    WhiteEdge = BRepBuilderAPI_MakeEdge(line,-20,10);

    下面为生成四分之一园边:

    gp_Elips Elips(gp_Ax2(gp_Pnt(10,0,0),gp_Dir(1,1,1)),60,30);

    RedEdge = BRepBuilderAPI_MakeEdge(Elips,0,PI/2);

    下面是由曲线生成边:

    Handle (Geom_BezierCurve) curve = new Geom_BezierCurve(array);

    BRepBuilderAPI_MakeEdge ME (curve);

    GreenEdge = ME;

    V3 = ME.Vertex1();

    V4 = ME.Vertex2();

    BRepBuilderAPI_MakeWire

    用来创建一个Wire类;

    用一个Wire和一个边来生成一个新的Wire:

    ExistingWire = BRepBuilderAPI_MakeWire(Edge2);

    Edge3 = BRepBuilderAPI_MakeEdge(gp_Pnt(-300,0,-80),gp_Pnt(-90,20,-30));

    BRepBuilderAPI_MakeWire MW1(ExistingWire,Edge3);

    if (MW1.IsDone()) {YellowWire = MW1;}

    用一个Wire和添加边的方法来生成Wire:

    BRepBuilderAPI_MakeWire MW;

    MW.Add(ExistingWire2);

    MW.Add(Edge5);

    MW.Add(Edge6);

    MW.Add(Edge7);

    if (MW.IsDone()) {

    WhiteWire = MW.Wire();

    LastEdge = MW.Edge();

    LastVertex = MW.Vertex();

    }

    BRepBuilderAPI_MakeFace

    生成一个面;有多种生成面的方法;

    --通过一个封闭曲线生成面:

    BRepBuilderAPI_MakeFace(curve);

    --通过一个Wire生成面:

    BrownFace = BRepBuilderAPI_MakeFace(YellowWire);

    Bnd_Box2d:

    定义一个二维空间的边界盒,可以得出边界盒各个点的值,有时,在某个方向是无限大,这种情况下,称为在此方向上是开放的;

    示例:

    Bnd_Box2d aCBox; 

    Geom2dAdaptor_Curve GACC (C); 

    BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox);

    Bnd_Box:

    定义一个三维空间的边界盒,可以扩大或缩小边界盒,也可以合并两个轴对齐边界盒;

    BRepPrimAPI_MakeBox

    用来生成一个立方体;

    构造一个立方体可以是两个对角点,一个角点及三个方向长度,可以是非轴对称的:

    TopoDS_Shape B2 = BRepPrimAPI_MakeBox (gp_Ax2(gp_Pnt(-200.,-80.,-70.), gp_Dir(1.,2.,1.)),  80.,90.,120.);

    使用方法

    TopoDS_Face& BottomFace() ;.可以得到立方体的底面;同样,用其它类似的方法可以获得顶面等;

    方法TopoDS_Solid& Solid() ;可以将box转化为一个Solid;

    方法TopoDS_Shell& Shell() ;可以将box转化为一个shell;

    BRepPrimAPI_MakeCylinder

    用来生成一个园柱体或园柱体的一部分;

    比如: 

    TopoDS_Shape C2 = BRepPrimAPI_MakeCylinder (gp_Ax2(gp_Pnt(200.,0.,200.), gp_Dir(0.,1.,0.)),40.,110.,210.*PI180);

    BRepPrimAPI_MakeCone

    生成一个园锥或园锥的一部分;

    BRepPrimAPI_MakeSphere

    生成球体或球体的一部分,可以是U方向切一部分或V方向切一部分;

    BRepPrimAPI_MakeTorus

    生成环或环的一部分;

    BRepPrimAPI_MakeWedge

    生成一个楔块或楔块的一部分;

    BRepPrimAPI_MakePrism

    生成一个线性的swept,称为Prisms;它的基类是BRepPrimAPI_MakeSweep类;BRepPrimAPI_MakeSweep类的基类是

    BRepBuilderAPI_MakeShape类

    注意,原始基本图形不可以包含任何实体:

    应用此类时:

    --顶点“推移”成边:

    TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(-200.,-200.,0.));

    Handle(AIS_Shape) ais1 = new AIS_Shape(V1); 

    TopoDS_Shape S1 = BRepPrimAPI_MakePrism(V1,gp_Vec(0.,0.,100.));

    Handle(AIS_Shape) ais2 = new AIS_Shape(S1);

    --边“推移”成面:.

    TopoDS_Edge E = BRepBuilderAPI_MakeEdge(gp_Pnt(-150.,-150,0.), gp_Pnt(-50.,-50,0.));

    Handle(AIS_Shape) ais3 = new AIS_Shape(E);

    myAISContext->Display(ais3,Standard_False);

    TopoDS_Shape S2 = BRepPrimAPI_MakePrism(E,gp_Vec(0.,0.,100.));

    --Wires “推移”成Shells.

    TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.));

    TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.));

    TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.));

    TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3);

    TopoDS_Shape S3 = BRepPrimAPI_MakePrism(W,gp_Vec(0.,0.,100.));

    --Faces “推移”成Solids.

    TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::XOY()),Wc);

    Handle(AIS_Shape) ais7 = new AIS_Shape(F);

    myAISContext->Display(ais7,Standard_False);

    TopoDS_Shape S4 = BRepPrimAPI_MakePrism(F,gp_Vec(0.,0.,100.));

    --Shells “推移”成复合实体

    BRepPrimAPI_MakeRevol

    一个回转sweep体;

    类继承关系和前面类似:BRepBuilderAPI_MakeShape--〉BRepPrimAPI_MakeSweep-->BRepPrimAPI_MakeRevol

    ,对于角度而言,范围是[0,2PI],默认值是2PI,生成规则:

    - Vertex -> Edge.

    - Edge -> Face.

    - Wire -> Shell.

    - Face-> Solid.

    - Shell-> CompSolid.

    BRepOffsetAPI_MakePipe

    可以生成一个管道

    类继承关系是:BRepBuilderAPI_MakeShape--〉BRepPrimAPI_MakeSweep-->BRepOffsetAPI_MakePipe

    以下为生成一个管道的示例过程:

    --利用生成一个WIRE,作为管道的路径:

    Handle(Geom_BezierCurve) curve = new Geom_BezierCurve(CurvePoles);

    TopoDS_Edge E = BRepBuilderAPI_MakeEdge(curve);

    TopoDS_Wire W = BRepBuilderAPI_MakeWire(E);

    --生成一个面,作为生成管道的截面:

    gp_Circ c = gp_Circ(gp_Ax2(gp_Pnt(0.,0.,0.),gp_Dir(0.,1.,0.)),10.);

    TopoDS_Edge Ec = BRepBuilderAPI_MakeEdge(c);

    TopoDS_Wire Wc = BRepBuilderAPI_MakeWire(Ec);

    TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp::ZOX()),Wc);

    --利用前两步生成的路径和截面来生成pipe:

    TopoDS_Shape S = BRepOffsetAPI_MakePipe(W,F);

    Handle(AIS_Shape) ais2 = new AIS_Shape(S);

    BRepOffsetAPI_ThruSections

    此类继承自BRepBuilderAPI_MakeShape:创建一个loft,通过一组给定的sections,生成一个shell或一个solid;通常,section是wire;但是第一个和最后一个section可以是

    vertices;

    比如:

    BRepOffsetAPI_ThruSections generator(Standard_False,Standard_True);

    generator.AddWire(W1);

    generator.AddWire(W2);

    generator.AddWire(W3);

    generator.AddWire(W4);

    generator.Build();

    TopoDS_Shape S1 = generator.Shape();

    Handle(AIS_Shape) ais1 = new AIS_Shape(S1);

    BRepBuilderAPI_MakePolygon

    创建一个polygonal wires,可以通过一组点或向量生成,也可以先生成一个空的对象,再添加点。

    示例1:

    BRepBuilderAPI_MakePolygon P;

    P.Add(gp_Pnt(0.,0.,0.));

    P.Add(gp_Pnt(200.,0.,0.));

    P.Add(gp_Pnt(200.,200.,0.));

    P.Add(gp_Pnt(0.,200.,0.));

    P.Add(gp_Pnt(0.,0.,0.));

    TopoDS_Wire W = P.Wire();

    示例2:

    TopoDS_Wire wprof = BRepBuilderAPI_MakePolygon(gp_Pnt(0.,0.,0.),gp_Pnt(-60.,-60.,-200.));

    BRepOffsetAPI_MakeEvolved

    创建一个可展图形,它是通过一个planar spine (face or wire)和一个rofile (wire)来生成的,它是一个非循环的sweep (pipe),用profile沿着spline;自相交点将被移除;

    比如:

    --沿着一个spline,sweep一个profile;

    Standard_EXPORT BRepOffsetAPI_MakeEvolved(const TopoDS_Face& Spine,const TopoDS_Wire& Profil,const GeomAbs_JoinType Join = GeomAbs_Arc,const Standard_Boolean

    AxeProf = Standard_True,const Standard_Boolean Solid = Standard_False,const Standard_Boolean ProfOnSpine = Standard_False,const Standard_Real Tol = 0.0000001);

    AxeProf参数如果为true,R是0,X,Y,Z;如果solid为真,结果为一个solid或复合的solids;

    示例:

    TopoDS_Shape

    S = BRepOffsetAPI_MakeEvolved(W,wprof,GeomAbs_Arc,Standard_True,Standard_False,Standard_True,0.0001);

    BRepBuilderAPI_ModifyShape

    当使用BRepTools来创建一个修改类,主要有以下派生类:

    --BRepBuilderAPI_Copy:处理一个图形的拷贝;

    --BRepBuilderAPI_Transform 和BRepBuilderAPI_GTransform:用来对一个图形应用几何变形;

    --BRepBuilderAPI_NurbsConvert:用来将一个图形转化为NURBS几何体;

    --BRepOffsetAPI_DraftAngle:创建一个tapered图形;

    BRepOffsetAPI_DraftAngle

    创建一个tapered图形;一般过程是:

    --初始化构造算法;

    --输入要taper的特征面;

    --实现算法;

    --生成结果;

    示例:

    TopoDS_Shape S = BRepPrimAPI_MakeBox(200.,300.,150.);

    BRepOffsetAPI_DraftAngle adraft(S);

    TopExp_Explorer Ex;

    for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) {

    TopoDS_Face F = TopoDS::Face(Ex.Current());

    Handle(Geom_Plane) surf = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(F));

    gp_Pln apln = surf->Pln();

    gp_Dir dirF = apln.Axis().Direction();

    if (dirF.IsNormal(gp_Dir(0.,0.,1.),Precision::Angular()))

    adraft.Add(F, gp_Dir(0.,0.,1.), 15.*PI180, gp_Pln(gp::XOY()));

    }

    ais1->Set(adraft.Shape());

    二:关于布尔等实体修改操作相关

    BRepAlgoAPI_BooleanOperation

    此类的基类是BRepBuilderAPI_MakeShape类,它是一个抽象类;

    可以应用的操作有:BOP_SECTION 、BOP_COMMON、BOP_FUSE、BOP_CUT、BOP_CUT21

    有时会产生错误,无法达到想要的结果,根据返回值,可以得到错误信息,含义是:

    0:OK

    1: 对象创建完成,但结果为空;

    2:源图形为空;

    3:参数类型检查错误;

    4:不能为DSFiller分配内存;

    5:此种类型参数的Builder无法工作;

    6:不允许的操作;

    7:不能为Builder分配内存;

    >100 参见Builder错误信息;

    相关的方法介绍:

    --TopTools_ListOfShape& SectionEdges()方法:返回一组截面的边,它们在布尔操作过程中生成;

    --Standard_Boolean HasDeleted()方法:如果至少一个图形对象被删除了,返回为真;

    --Standard_Boolean HasGenerated()方法:如果至少生成了一个图形,返回为真;

    --Standard_Boolean HasModified()方法:如果至少一个图形被修改了,返回为真;

    --TopTools_ListOfShape& Generated(const TopoDS_Shape& S) 方法:返回生成以后的图形的集合;

    --TopTools_ListOfShape& Modified2(const TopoDS_Shape& aS)方法:返回修改后的图形的集合;

    --Standard_Boolean IsDeleted(const TopoDS_Shape& aS)方法:如果图形S已经被删除,返回为真,即结果图形中不包括图形S;

    -BOP_Operation Operation()方法:返回布尔操作的类型;

    布尔操作类

    包括有BRepAlgoAPI_Cut类, BRepAlgoAPI_Fuse类,BRepAlgoAPI_Common类:布尔交集;

    BRepAlgoAPI_Section

    计算两个图形或几何体的截面,几何对象可以是平面的表面,转化为face.

    示例:

    给定两个图形S1和S2,计算在S1和S2上的边,在新曲线上生成近似值,结果在第一部分上而不在第二部分上:

    Standard_Boolean PerformNow = Standard_False;

    BRepBoolAPI_Section S(S1,S2,PerformNow);

    S.ComputePCurveOn1(Standard_True);

    S.Approximation(Standard_True);

    S.Build();

    TopoDS_Shape R = S.Shape();

    如果结果为空,调用NotDone();

    常见方法:

    --BRepAlgoAPI_Section(const Handle(Geom_Surface)& Sf1,const Handle(Geom_Surface)& Sf2,const Standard_Boolean

    PerformNow = Standard_True);

    用来生成线:

    --两个图形SH1和SH2;

    --图形SH和平面P1;

    --表面SF和图形SH;

    --两个表面SF1和SF2;

    参数PerformNow如果为真,将直接计算结果,如果为假,表示后面将通过Build()这个函数来计算结果;

    生成后的图形是由方法Shape()得出的;

    这些相交的边是独立的,不在一个链表上,也不在一个wire上,如果不存在一个相交边,返回结果为空;

    示例:

    --计算相交的基本边--利用这些基本边创建一个相交线--决定相交线在两个图形的哪个图形的参数空间;

    TopoDS_Shape S1 = ... , S2 = ... ;

    Standard_Boolean PerformNow = Standard_False;

    BRepAlgoAPI_Section S ( S1, S2, PerformNow );

    S.ComputePCurveOn1 (Standard_True);

    S.Approximation (Standard_True);

    S.Build();

    TopoDS_Shape R = S.Shape();

    BRepFilletAPI_LocalOperation

    基类是BRepBuilderAPI_MakeShape;

    构造在一个shell的边的园角;常用方法有

    --void Add(const TopoDS_Edge& E)  = 0;在builder上添加一个轮廓线;

    --void ResetContour(const Standard_Integer IC)  = 0;重置索引为IC的轮廓线;

    --Standard_Integer NbContours() const = 0;返回轮廓线的数目;

    --Standard_Integer Contour(const TopoDS_Edge& E) const = 0;返回边E的轮廓线的索引,如果边E不在轮廓线内,返回为O;

    --Standard_Integer NbEdges(const Standard_Integer I) const = 0;返回在轮廓线I中的边数;

    --void Remove(const TopoDS_Edge& E)  = 0;移除一个边;

    --Standard_Real Length(const Standard_Integer IC) const = 0;得到某个轮廓线的长度;

    --TopoDS_Vertex FirstVertex(const Standard_Integer IC) const = 0;返回某个轮廓线的第一个顶点;LastVertex方法返回最后一个顶点;

    --Abscissa方法,返回某个顶点的横坐标;

    --Standard_Boolean ClosedAndTangent(const Standard_Integer IC) const如果某个轮廓线是封闭切线,返回为真;

    --Standard_Boolean Closed(const Standard_Integer IC) const = 0;如果某个轮廓线是封闭,返回为真;

    --Reset()  = 0;重置所有;

    BRepFilletAPI_MakeFillet

    创建一个园角;

    示例一:

    对一个BOX园角:

    BRepFilletAPI_MakeFillet fillet(Box);

    for (TopExp_Explorer ex(Box,TopAbs_EDGE); ex.More(); ex.Next()) {

    TopoDS_Edge Edge =TopoDS::Edge(ex.Current());

    fillet.Add(20,Edge);

    }

    示例二:

    两个BOX,合并后园角;

    TopoDS_Shape fusedShape = BRepAlgoAPI_Fuse(S1,S2);

    BRepFilletAPI_MakeFillet fill(fusedShape);

    for (TopExp_Explorer ex1(fusedShape,TopAbs_EDGE); ex1.More(); ex1.Next()) {

    TopoDS_Edge E =TopoDS::Edge(ex1.Current());

    fill.Add(E);

    }

    for (Standard_Integer i = 1;i<=fill.NbContours();i++) {

    Standard_Real longueur(fill.Length(i));

    Standard_Real Rad(0.15*longueur);

    fill.SetRadius(Rad,i, 1);

    }

    TopoDS_Shape blendedFusedSolids = fill.Shape();

    Handle(AIS_Shape) aBlend = new AIS_Shape(blendedFusedSolids);

    示例三:

    只园角其中一条边:

    BRepFilletAPI_MakeFillet Rake(theBox);

    TopExp_Explorer ex(theBox,TopAbs_EDGE);

    ex.Next();

    ex.Next();

    ex.Next();

    ex.Next();

    Rake.Add(8,50,TopoDS::Edge(ex.Current()));

    Rake.Build();

    if (Rake.IsDone() ){

    TopoDS_Shape evolvedBox = Rake.Shape();

    ais1->Set(evolvedBox);

    }

    示例四:

    园角一个园柱:

    BRepFilletAPI_MakeFillet fillet(theCylinder);

    TColgp_Array1OfPnt2d TabPoint2(1,20);

    for (Standard_Integer i=0; i<=19; i++) {

    gp_Pnt2d Point2d(i*2*PI/19,60*cos(i*PI/19-PI/2)+10);

    TabPoint2.SetValue(i+1,Point2d);

    }

    TopExp_Explorer exp2(theCylinder,TopAbs_EDGE);

    fillet.Add(TabPoint2,TopoDS::Edge(exp2.Current()));

    fillet.Build();

    if (fillet.IsDone() ){

    TopoDS_Shape LawEvolvedCylinder = fillet.Shape();

    ais3->Set(LawEvolvedCylinder);

    myAISContext->Redisplay(ais3,Standard_False);

    myAISContext->SetCurrentObject(ais3,Standard_False);

    }

    BRepFilletAPI_MakeChamfer

    创建一个倒角;

    基类:BRepFilletAPI_LocalOperation;

    可以设置相关参数,比如倒角两个距离,角度等参数;

    示例:

    BRepFilletAPI_MakeChamfer MC(theBox);

    // add all the edges to chamfer

    TopTools_IndexedDataMapOfShapeListOfShape M;

    TopExp::MapShapesAndAncestors(theBox,TopAbs_EDGE,TopAbs_FACE,M);

    for (Standard_Integer i = 1;i<=M.Extent();i++) {

    TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));

    TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());

    MC.Add(5,5,E,F);

    }

    BRepBuilderAPI_MakeShell

    生成一个表面的外壳,注意,一个图形的外壳,不是一个由表面和厚度定义的实体模型,如果想要创建这种壳,需要使用BRepOffsetAPI_MakeOffsetShape,一个外壳是由一系列相互通过普通的边连接起来的面;如果表面是C2连续的,外壳将只有一个面;如果表面不是C2连续的,将把一些面细分成所有的面都是C2连续的,结果是外壳包含所有这些面;通过一个非C2连续的表面来生成一个外壳,一般过程是:--构造一个外壳对象--实现算法--生成结果;

    注意:表面分解的这些C2面并没有缝合在一起,需要使用BRepOffsetAPI_Sewing,如果想实现带厚度的外壳,需要使用BRepOffsetAPI_MakeOffsetShape类;

    BRepBuilderAPI_Sewing

    将多个邻近图形“缝合”成为一个图形;同时有多个边的情况下无法缝合;

    一般操作过程是:

    --创建一个空对象;

    缺省的公差是1.E-06;

    面分析;

    缝合操作;

    根据需要作剪操作;

    --定义公差;

    --添加要缝合的对象;

    --计算生成;

    --输出结果图形;

    --如果需要可以输出自由边;

    --如果需要可以输出多个边;

    --输出其它问题;

    主要方法:

    --构造函数:

    option1 如果为假表示只控制;

    option2:分析退化的图形;

    option3:为自由边的剪操作;

    option4:未复制处理;

    BRepBuilderAPI_Sewing(const Standard_Real tolerance = 1.0e-06,const Standard_Boolean option1 = Standard_True,const Standard_Boolean option2 = Standard_True,const Standard_Boolean option3 = Standard_True,const Standard_Boolean option4 = Standard_False);

    如果必要,可以初始化参数;

    void Init(const Standard_Real tolerance = 1.0e-06,const Standard_Boolean option1 = Standard_True,const Standard_Boolean option2 = Standard_True,const Standard_Boolean option3 = Standard_True,const Standard_Boolean option4 = Standard_False) ;

    --添加一个要缝合的图形的方法是;

    void Add(const TopoDS_Shape& shape) ;

    --生成图形方法是:

    void Perform() ;

    --得到缝合后的图形方法是:

    TopoDS_Shape& SewedShape() const;

    --得到自由边(只被一个面共享的边)的数量方法是:

    Standard_Integer NbFreeEdges() const;

    --得到一个自由边的方法是:

    const TopoDS_Edge& FreeEdge(const Standard_Integer index) const;

    --得到复合边(被两个及以上面共享的边)的数量:

    Standard_Integer NbMultipleEdges() const;

    --得到其中的一个复合边:

    const TopoDS_Edge& MultipleEdge(const Standard_Integer index) const;

    --得到邻近边的数量:

    Standard_Integer NbContigousEdges() const;

    --得到其中一个邻近边:

    const TopoDS_Edge& ContigousEdge(const Standard_Integer index) const;

    --得到有一个邻近边的边的集合(截面);

    const TopTools_ListOfShape& ContigousEdgeCouple(const Standard_Integer index) const;

    --一个截面是否是有边界的(使用SectionToBoundary方法之前):

    Standard_Boolean IsSectionBound(const TopoDS_Edge& section) const;

    --得到成为截面的原始边。记住,截面是由普通边所组成的,这个信息对于控制来说是很重要的,因为通过原始边可以找到被附加的截面的表面;

    const TopoDS_Edge& SectionToBoundary(const TopoDS_Edge& section) const;

    --得到每一个退化的图形:

    const TopoDS_Shape& DegeneratedShape(const Standard_Integer index) const;

    --此图形是否是退化的图形:

    Standard_Boolean IsDegenerated(const TopoDS_Shape& shape) const;

    --此图形是否已被修改过:

    Standard_Boolean IsModified(const TopoDS_Shape& shape) const;

    --得到一个修改后的图形:

    const TopoDS_Shape& Modified(const TopoDS_Shape& shape) const;

    --子图形是否被修改过:

    Standard_Boolean IsModifiedSubShape(const TopoDS_Shape& shape) const;

    --得到一个修改过的子图形:

    TopoDS_Shape ModifiedSubShape(const TopoDS_Shape& shape) const;

    --得到每一个被删除的面:

    const TopoDS_Face& DeletedFace(const Standard_Integer index) const;

    --void Dump() const;打印相关信息;

    --得到一个修改后的图形:

    TopoDS_Face WhichFace(const TopoDS_Edge& theEdg,const Standard_Integer index = 1) const;

    示例:

    BRepOffsetAPI_Sewing aMethod;

    aMethod.Add(FirstShape); 

    aMethod.Add(SecondShape);

    aMethod.Perform();

    TopoDS_Shape sewedShape = aMethod.SewedShape();

    Handle(AIS_Shape) result = new AIS_Shape(sewedShape);

    BRep_Tool

    提供了处理BRep图形几何对象的一些方法;

    如果S是一个Solid,Shell,或Compound.返回为真;

    Standard_Boolean IsClosed(const TopoDS_Shape& S) ;

    返回在位置L处的几何表面:

    Handle_Geom_Surface& Surface(const TopoDS_Face& F,TopLoc_Location& L) ;

    返回面的几何表面,如果有一个位置可以是一个拷贝;

    Handle_Geom_Surface Surface(const TopoDS_Face& F) ;

    返回面的多边三角形,如果没有三角形返回一个空句柄:

    const Handle_Poly_Triangulation& Triangulation(const TopoDS_Face& F,TopLoc_Location& L) ;

    返加面的公差值:

    Standard_Real Tolerance(const TopoDS_Face& F) ;

    返回面的自然约束标志:

    Standard_Boolean NaturalRestriction(const TopoDS_Face& F) ;

    如果E是一个3D曲线或表面上的一个曲线,返回为真;

    Standard_Boolean IsGeometric(const TopoDS_Edge& E) ;

    返回边的3D曲线,可以是NULL,返回L位置,及参数范围;

    Handle_Geom_Curve& Curve(const TopoDS_Edge& E,TopLoc_Location& L,Standard_Real& First,Standard_Real& Last) ;

    返回边的3D多边形,返回多边形的位置L;

    Handle_Poly_Polygon3D& Polygon3D(const TopoDS_Edge& E,TopLoc_Location& L)

    TopLoc_Location

    一个Location 是一个复合的平移;对象类型是TopLoc_Datum3D;

    常见方法:

    --TopLoc_Location();

    构造一个空的局部坐标系统对象;注意,这种被构造的缺省的数据为空;、

    --TopLoc_Location(const gp_Trsf& T);

    通过T构造一个局部坐标系统;

    --TopLoc_Location(const Handle(TopLoc_Datum3D)& D);

    通过3D datum D来构造一个局部坐标系统,如果平移T不能表达一个局部坐标系统,会引发构造异常;

    --Standard_Boolean IsIdentity() const;如果此位置等于一个单位化平移,返回为真;

    -- void Identity() ;设置位置为单位化平移;

    --Handle_TopLoc_Datum3D& FirstDatum() 得到位置的第一个基础数据;

    -- const TopLoc_Location& NextLocation() const;

    另外,具有加减乘除,是否相等方法;

    示例:

    炸开一个立方体的六个面:

    for (TopExp_Explorer exp (aBox,TopAbs_FACE);exp.More();exp.Next()) {

    TopoDS_Face aCurrentFace = TopoDS::Face(exp.Current());

    //测试当前面的方向

    TopAbs_Orientation orient = aCurrentFace.Orientation();

    //重新生成几何平面

    TopLoc_Location location;

    Handle (Geom_Surface) aGeometricSurface = BRep_Tool::Surface(aCurrentFace,location);

    Handle (Geom_Plane) aPlane = Handle (Geom_Plane)::DownCast(aGeometricSurface);

    //Build an AIS_Shape with a new color

    //创建一个新的AIS_Shape

    Handle(AIS_Shape) theMovingFace = new AIS_Shape(aCurrentFace);

    Quantity_NameOfColor aCurrentColor = (Quantity_NameOfColor)j;

    myAISContext->SetColor(theMovingFace,aCurrentColor,Standard_False);

    myAISContext->SetMaterial(theMovingFace,Graphic3d_NOM_PLASTIC,Standard_False); 

    //查找每个面的法向量

    gp_Pln agpPlane = aPlane->Pln();

    gp_Ax1 norm = agpPlane.Axis();

    gp_Dir dir = norm.Direction();

    gp_Vec move(dir);

    TopLoc_Location aLocation;

    Handle (AIS_ConnectedInteractive) theTransformedDisplay = new AIS_ConnectedInteractive();

    theTransformedDisplay->Connect(theMovingFace, aLocation);

    // = myAISContext->Location(theMovingFace);

    Handle (Geom_Transformation) theMove = new Geom_Transformation(aLocation.Transformation());

    for (Standard_Integer i=1;i<=30;i++) {

    theMove->SetTranslation(move*i);

    if (orient==TopAbs_FORWARD) myAISContext->SetLocation(theTransformedDisplay,TopLoc_Location(theMove->Trsf()));

    else myAISContext->SetLocation(theTransformedDisplay,TopLoc_Location(theMove->Inverted()->Trsf()));

    myAISContext->Redisplay(theTransformedDisplay,Standard_False);

    }

    j+=15;

    }

    BRepAlgo

    BRepAlgo提供了一些布尔操作的服务;

    注意,在BrepAlgoAPI包中提供了新的布尔操作,代替了旧的布尔操作;

    方法:

    --static  Standard_Boolean IsValid(const TopoDS_Shape& S) ;检测图形是否合法;

    --Standard_EXPORT static  Standard_Boolean IsValid(const TopTools_ListOfShape& theArgs,const TopoDS_Shape&

    theResult,const Standard_Boolean closedSolid = Standard_False,const Standard_Boolean GeomCtrl = Standard_True) ;

    检查在结果图形中所生成和修改后的面是否合法,参数theArgs可以为空,表示所有的面都被检查;如果closedSolid 为真,表示只有封闭的图形合法,如果参数GeomCtrl为假,几何体的顶点和边不检查,自相交的新的wire也不检查;

    --Standard_Boolean IsTopologicallyValid(const TopoDS_Shape& S) ;

    也是检查图形是否合法,和前一个不同的是,检查 no  geometric contols (intersection  of wires, pcurve validity) are

    performed.

    GProp_GProps

    计算图元的属性;

    gp_Trsf

    定义一个矩阵变换的类

    --可以定义平移、旋转、缩放的矩阵;

    --可以对称于一个点,一条线,一个平面;

    示例一:

    对称于一个点:

    gp_Trsf theTransformation;

    gp_Pnt PntCenterOfTheTransformation(110,60,60);

    theTransformation.SetMirror(PntCenterOfTheTransformation);

    示例二:

    绕一个轴旋转:

    gp_Trsf theTransformation;

    gp_Ax1 axe = gp_Ax1(gp_Pnt(200,60,60),gp_Dir(0.,1.,0.));

    theTransformation.SetRotation(axe,30*PI/180);

    示例三:

    缩放:

    gp_Trsf theTransformation;

    gp_Pnt theCenterOfScale(200,60,60);

    theTransformation.SetScale(theCenterOfScale,0.5);

    示例四:

    平移:

    gp_Trsf theTransformation;

    gp_Vec theVectorOfTranslation(-6,-6,6);

    theTransformation.SetTranslation(theVectorOfTranslation);

    示例五:

    Displacement:

    TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.);

    gp_Trsf theTransformation;

    gp_Ax3 ax3_1(gp_Pnt(0,0,0),gp_Dir(0,0,1));

    gp_Ax3 ax3_2(gp_Pnt(60,60,60),gp_Dir(1,1,1));

    theTransformation.SetDisplacement(ax3_1,ax3_2);

    BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);

    TopoDS_Shape TransformedShape = myBRepTransformation.Shape();

    示例六:

    变形

    gp_GTrsf theTransformation;

    gp_Mat rot(1, 0, 0, 0, 0.5, 0, 0, 0, 1.5);

    theTransformation.SetVectorialPart(rot);

    theTransformation.SetTranslationPart(gp_XYZ(5,5,5));

    BRepBuilderAPI_GTransform myBRepTransformation(S,theTransformation);

    TopoDS_Shape S2 = myBRepTransformation.Shape();

    BuilderAPI_MakeEdge

    定义一生成一个边;此类有多个构造函数,现举其中一个介绍如下:

    Standard_EXPORT BRepBuilderAPI_MakeEdge(const Handle(Geom2d_Curve)& L,const Handle(Geom_Surface)& S,const TopoDS_Vertex& V1,const TopoDS_Vertex& V2,const Standard_Real p1,const Standard_Real p2);

    其参数含义是:

    顶点V1和V2用来限制曲线(定义边的约束),值p1和p2为顶点的参数;

    曲线可以定义成在一个表面的2D曲线,应用缺省的公差;

    参数规则:

    对于曲线来说:

    --句柄不能为空;

    --如果曲线是一个trimmed曲线,使用基础曲线;

    对于顶点来说:

    --可以为空,表示此参数为无限大;静态方法 Precision::Infinite()用来定义一个无限大的数;

    --两个顶点如果位于同一位置,必须一样,当曲线是封闭时使用相同的顶点;

    对于参数来说:

    --参数为必须在曲线参数范围内,如果曲线是trimmed,使用基础曲线;如果边的条件不满足,返回BRepAPI_ParameterOutOfRange错误;

    --参数值不能相等,如果条件不满足,边无法创建,返回BRepAPI_LineThroughIdenticPoints错误;

    --参数值可以这样给出C->FirstParameter()

    --如果参数值需要切换,比如第一个顶点的参数为P2,第二个顶点的参数为P1,边的方向可以“reversed”;

    --对于一个周期曲线,值P1和P2可以通过加或减周期来得到;

    --参数值可以无限大,在对应的方向上边是开放的。然而,对应的顶点必须是空图形,如果条件不满足,边无法创建,返回BRepAPI_PointWithInfiniteParameter错误;

    --参数值可以被忽略,将通过曲线上的投影进行计算;

    --可以给定空间三维点;

    BRepFeat_MakePipe

    基类为:BRepFeat_Form;

    通过基本图形生成一个Pipe;

    BRepFeat_MakeLinearForm

    基类为:BRepFeat_RibSlot

    在一个平面表面上建一个肋或开凹槽;

    BRepFeat_Gluer

    粘合两个实体为一个实体;

    示例:

    (1):创建两个BOX,并找到要粘合的面;

    (2):创建要粘合的对象:

    BRepFeat_Gluer glue2(S4,S3);

    (3):用两个面粘合对象;

    glue2.Bind(F4,F3);

    (4):重新生成对象:

    LocOpe_FindEdges CommonEdges(F4,F3);

    for (CommonEdges.InitIterator(); CommonEdges.More(); CommonEdges.Next())

    glue2.Bind(CommonEdges.EdgeFrom(),CommonEdges.EdgeTo());

    TopoDS_Shape res2 = glue2.Shape();

    myAISContext->Erase(ais3,Standard_False,Standard_False);

    ais4->Set(res2);

    myAISContext->Redisplay(ais4,Standard_False);

    Graphic2d_Polyline

    创建一个多边形.

    常见方法:

    --Length()得到线的点数;

    --void Values(const Standard_Integer aRank,Quantity_Length& X,Quantity_Length& Y) const;得到序号为aRank的点;

    --void DrawElement(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Integer anIndex) ;绘制多边形的一条边;

    --void DrawVertex(const Handle(Graphic2d_Drawer)& aDrawer,const Standard_Integer anIndex) ;绘制多边形的一个顶点;

    --Standard_Boolean Pick(const Standard_ShortReal X,const Standard_ShortReal Y,const Standard_ShortReal aPrecision,const Handle(Graphic2d_Drawer)& aDrawer) ;得到此多边形是否被拾取,注意:PickIndex()方法得到的是最后拾取的点,如果拾取点在线的内部,返回0;

    Graphic2d_Line

    是Polyline, Circle ... 等图元的基类;

    常见方法:

    --SetWidthIndex(const Standard_Integer anIndex) ;得到在width map中的宽度的索引;设定对应的线宽值;

    --SetTypeIndex(const Standard_Integer anIndex) ;设置线型;

    --SetInteriorColorIndex(const Standard_Integer anIndex) ;设置颜色;

    --void SetDrawEdge(const Standard_Boolean aDraw) ;设置边是否绘出,注意,这种情况下,polygon的类型必须为:

    Graphic2d_TOPF_FILLED 或者 Graphic2d_TOPF_PATTERNED;

    --SetInteriorPattern(const Standard_Integer anIndex) ;定义封闭线的内部图案,polygon的填充类型必须是:Graphic2d_TOPF_PATTERNED;

    --SetTypeOfPolygonFilling(const Graphic2d_TypeOfPolygonFilling aType) ;定义封闭线的图案,TypeOfPolygonFilling可选类型有:

    - Graphic2d_TOPF_EMPTY - Graphic2d_TOPF_FILLED - Graphic2d_TOPF_PATTERNED ;

    --Standard_Integer InteriorColorIndex() const;得到颜色索引;

    --Standard_Integer InteriorPattern() const;得到所使用的图案索引;

    --Graphic2d_TypeOfPolygonFilling TypeOfPolygonFilling() const;得到多边形填充模式;

    Graphic2d_Primitive

    是Graphic2d_Line类的基类,

    常见方法:

    --得到及获取颜色索引;

    --得到图元元素的数量和顶点的数量:

    Standard_Integer NumOfElemIndices() const;

    Standard_Integer NumOfVertIndices() const;

    --Standard_Integer PickedIndex() const;得到最后拾取的图元元素的索引值;

    --void Highlight(const Standard_Integer anIndex = 0) ;高亮显示图元或图元的一部分,当anIndex=0表示所有的图元高亮显示,>0为当所要求的图元元素高亮显示时,<0为所要求的顶点高亮显示时;

    --void Unhighlight() ;禁止图元高亮显示;

    -- Standard_Boolean IsHighlighted() const;图元是否高亮显示;

    --Handle_TColStd_HSequenceOfInteger HighlightIndices() const;得到图元高亮显示的索引序列;

    --void SetDisplayMode(const Standard_Integer aMode) ;设置图元显示的模式;

    --Standard_Integer DisplayMode() const;得到图元显示的模式;

    --Standard_Boolean Graphic2d_GraphicObject::Pick(const Standard_Real X,const Standard_Real Y,const Standard_Real aPrecision,const Handle(Graphic2d_Drawer)& aDrawer) ;

    用一个矩形框拾取图形对象,如果图形对象被拾取,返回为真,通过方法Graphic2d_View::Pick调用;

    --Standard_Boolean Graphic2d_GraphicObject::PickByCircle(const Standard_Real X,const Standard_Real Y,const Standard_Real Radius,const Handle(Graphic2d_Drawer)& aDrawer) ;

    用一个园来拾取图形对象,如果图形对象被拾取,返回为真,通过方法Graphic2d_View::PickByCircle调用;

    --Standard_Boolean Graphic2d_GraphicObject::Pick(const Standard_Real Xmin,const Standard_Real Ymin,const Standard_Real Xmax,const Standard_Real Ymax,const Handle(Graphic2d_Drawer)& aDrawer,const Graphic2d_PickMode aPickMode) ;

    以下情况下返回值为真:

    包括在矩形内:included in rectangle (),

    不在矩形内:excluded from rectangle (),

    相交于矩形框:intersected by rectangle (),

    通过 Xmin, Ymin, Xmax, Ymax定义矩形框。

    --得到所有在图元内的markers的最小最大值,注意,如果me为空,或未显示,或没有markers返回为假,

    Minx = Miny = RealFirst () ;Maxx = Maxy = RealLast ()

    Standard_EXPORT  Standard_Boolean Graphic2d_GraphicObject::MarkerMinMax(Quantity_Length& Minx,Quantity_Length& Maxx,Quantity_Length& Miny,Quantity_Length& Maxy) const;

    --移除图元;Standard_EXPORT  void Graphic2d_GraphicObject::RemovePrimitive(const Handle(Graphic2d_Primitive)& aPrimitive) ;

    --绘制图元,以默认的图元属性绘制;void Graphic2d_TransientManager::Draw(const Handle(Graphic2d_Primitive)& aPrimitive) ;

    AIS2D_InteractiveObject

    使用显示和选择服务,来可视化和选择机制,交互式对象常用来显示数据,曲线,图形,markers,尺寸标注等。

    常用方法:

    --获取及设置属性

    Handle_Prs2d_Drawer Attributes() const;

    void SetAttributes(const Handle(Prs2d_Drawer)& aDrawer) ;

    --通过Aspect设置属性,到所有图元分配这个Aspect.

    Standard_EXPORT  void SetAspect(const Handle(Prs2d_AspectRoot)& anAspect) ;

    --通过Aspect设置属性,到所有通过InteractiveContext被链接的图元对象;

    Standard_EXPORT  void SetAspect(const Handle(Prs2d_AspectRoot)& anAspect,const Handle(Graphic2d_Primitive)& aPrimitive) ;

    --得到图元的Aspect;

    Standard_EXPORT  Handle_Prs2d_AspectRoot GetAspect(const Handle(Graphic2d_Primitive)& aPrimitive) const;

    --如果图元用一个aspect链接的话返回为真;

    Standard_EXPORT  Standard_Boolean HasAspect(const Handle(Graphic2d_Primitive)& aPrimitive) const;

    --指出交互对象是否有一个交互上下文设备;

    Standard_EXPORT  Standard_Boolean HasInteractiveContext() const;

    --得到交互对象的上下文设备; 

    Standard_EXPORT  Handle_AIS2D_InteractiveContext GetContext() const;

    Graphic2d_GraphicObject

    是AIS2D_InteractiveObject类的基类;在一个view内创建一个图形对象,一个图形对象管理一系列图元;默认值为:空,可输出,可绘制,可拾取,不显示,不高亮,优先权为0;

    主要方法:

    设置视图,设置一个变形,设置获取图层,设置获取优先权,禁用/使用输出,是否可输出,禁用/使用Draw.是否可显示,Erase,高亮显示,颜色,拾取等;

    Graphic2d_ImageFile

    定义一个图像,以图像的中心位置作为插入点,X,Y定义在模型空间的位置,adx,ady 定义在设备空间的偏移量.ascale定义一个缩放系数;

    Aspect_WidthMap

    定义一个WidthMap集合对象;

    主要方法有,

    --添加一个入口:

    Standard_Integer AddEntry(const Aspect_WidthOfLine aStyle) ;

    void AddEntry(const Aspect_WidthMapEntry& AnEntry) ;

    Standard_Integer AddEntry(const Quantity_Length aStyle) ;

    --根据索引得到一个入口:

    Aspect_WidthMapEntry Entry(const Standard_Integer AnIndex) const;

    示例:

    --定义private :

    Handle(Aspect_WidthMap) myWidthMap;

    --遍历:

    for(int i =1;i<=myWidthMap->Size();i++)

    {

    Aspect_WidthMapEntry aWidthMapEntry = myWidthMap->Entry(i);

    }

    --得到一个入口:  Aspect_WidthMapEntry aWidthMapEntry = myWidthMap->Entry(CurrentSelectionIndex);

    Aspect_TypeMap

    定义一个线型集合对象:

    Aspect_MarkMap

    定义一个MarkMap集合对象;

    Aspect_FontMap

    定义一个字体集合对象;

    Aspect_ColorMap

    定义一个颜色集合对象;

    GGraphic2d_SetOfCurves

    基类是:Graphic2d_Line;

    定义一图元为由多个curves 的集合;主要方法有添加一个curves, 得到curves的数量,得到其中一个curves等;只绘制其中一个元素,是否为拾取状态;

    示例:

    Handle(Prs2d_AspectLine) aLineAspect = new Prs2d_AspectLine; 

    aLineAspect->SetTypeOfFill(Graphic2d_TOPF_EMPTY);

    aLineAspect->SetTypeIndex(...);

    aLineAspect->SetColorIndex(...);

    aLineAspect->SetWidthIndex(...);

    Handle(Graphic2d_SetOfCurves) segment;

    segment = new Graphic2d_SetOfCurves(this);

    segment->Add(myGeom2dCurve);

    将此曲线集合应用所定义的线型线宽等;

    SetAspect(aLineAspect, segment);

    创建交互式对象相关的类介绍

    AIS_Line

    此类的继承关系是:

    Standard_Transient->MMgt_TShared->PrsMgr_PresentableObject-->SelectMgr_SelectableObject-->AIS_InteractiveObject->AIS_Line

    Standard_Transient:抽象类,主要定义分配空间,得到类型,引用计数等;

    MMgt_TShared:抽象类,主要用来管理对象的内存;

    PrsMgr_PresentableObject类:表示一个可表达的二维或三维图形对象;主要方法有设置位置,更新,图形类型等;

    此类的派生类类型有:

    -AIS_InteractiveObject

    -AIS_ConnectedInteractive

    -AIS_MultipleConnectedInteractive

    -AIS_Shape

    SelectMgr_SelectableObject类:表示一个可选择的对象;

    AIS_LineAIS_Circle等类

    定义一个直线,园等;主要方法有,返回对象的类型,设置线宽,线型,颜色等;

    示例:

    GC_MakeCircle C(gp_Pnt(-100.,-300.,0.),gp_Pnt(-50.,-200.,0.),gp_Pnt(-10.,-250.,0.));

    Handle(AIS_Circle) anAISCirc = new AIS_Circle(C.Value());

    myAISContext->Display(anAISCirc);

    AIS_InteractiveContext

    交互式设备类,可以用它来管理交互式图形对象,可以在一个或多个视图中。如果图形对象已经装入交互式设备,可以直接调用交互式对象的方法。

    使用设备时必须区分两种状态:

    -没有打开本地设备。也称为不确定点;

    -打开了一个或多个设备;

    有的方法可以使用在打开的设备中,有的方法用在关闭的设备中,有的方法与设备状态无关;

    --当想工作在一个入口类型上,应设置选项UseDisplayedObjects为假,可显示对象可以重新可视化交互对象;

    --当使用缺省的选项来打开一个设备时,注意:

    :可视化的交互对象在缺省选择模式下是活动的,必须分离那些不想使用的对象;

    :交互式对象可以自动分解为子图形;

    :“临时的”交互对象不会自动计入总数,,如果想使用它,必须手动装载它;

    使用过程是:

    --用正确的选项打开设备;

    --装载/显示对象;

    --如果需要,激活标准模式;

    --创建一个过滤器,添加到设备中;

    --查找/选择/重置所需的入口;

    --根据索引关闭设备;

    --创建一个交互设备编辑器很有用,可以设置不同的设备用不用的选择/表达方式;

    常见方法:

    --如果没有设备打开,交互对象没有显示模式,缺省的显示模式是0,如果一个设备是打开的并且更新为假,对象不会更新显示。

    void Display(const Handle(AIS_InteractiveObject)& anIobj,const Standard_Integer amode,const Standard_Integer

    aSelectionMode,const Standard_Boolean updateviewer = Standard_True,const Standard_Boolean allowdecomposition =

    Standard_True) ;

    --使用给定的选择模式载入一个交互对象:

    void Load(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Integer SelectionMode = -1,const Standard_Boolean

    AllowDecomp = Standard_False) ;

    --擦除一个对象:如果putinCollector为假,对象被擦除但不放入集合中;

    void Erase(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Boolean updateviewer = Standard_True,const

    Standard_Boolean PutInCollector = Standard_True) ;

    --擦除视图集合中的每个对象;

    void EraseAll(const Standard_Boolean PutInCollector = Standard_True,const Standard_Boolean updateviewer = Standard_True) ;

    --从集合中显示所有对象;

    void DisplayAll(const Standard_Boolean OnlyFromCollector = Standard_True,const Standard_Boolean updateviewer =

    Standard_True) ;

    --从集合中显示一个对象;

    void DisplayFromCollector(const Handle(AIS_InteractiveObject)& anIObj,const Standard_Boolean updateviewer = Standard_True)

    --擦除选择的对象;

    void EraseSelected(const Standard_Boolean PutInCollector = Standard_True,const Standard_Boolean updateviewer =

    Standard_True) ;

    --改变临时对象的状态,

    Standard_Boolean KeepTemporary(const Handle(AIS_InteractiveObject)& anIObj,const Standard_Integer InWhichLocal = -1) ;

    --从所有的视图中移除交互对象;

    void Clear(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Boolean updateviewer = Standard_True) ;

    --从每个视图中移除对象; 

    void Remove(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Boolean updateviewer = Standard_True) ;

    --从所有打开的设备中移除所有对象;

    void RemoveAll(const Standard_Boolean updateviewer = Standard_True) ;

    --通过鼠标动态检测,感知的图元被高亮显示。缺省的鼠标移过时的颜色为白色。

    void Hilight(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Boolean updateviewer = Standard_True) ;

    --改变视图中线的颜色;

    void HilightWithColor(const Handle(AIS_InteractiveObject)& aniobj,const Quantity_NameOfColor aCol,const Standard_Boolean updateviewer = Standard_True) ;

    --从入口对象中移除高亮;更新视图;

    void Unhilight(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Boolean updateviewer = Standard_True) ;

    --设置显示的优先权;

    void SetDisplayPriority(const Handle(AIS_InteractiveObject)& anIobj,const Standard_Integer aPriority) ;

    --设置所看到的交互对象的显示模式;

    void SetDisplayMode(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Integer aMode,const Standard_Boolean

    updateviewer = Standard_True) ;

    --设置/移除交互对象的选择模式:

    void SetSelectionMode(const Handle(AIS_InteractiveObject)& aniobj,const Standard_Integer aMode) ;

    void UnsetSelectionMode(const Handle(AIS_InteractiveObject)& aniobj) ;

    --设置感知的精度:

    void SetSensitivity(const Standard_Real aPrecision) ;

    --定义当前选择感知的像素:

    void SetSensitivity(const Standard_Integer aPrecision = 4) ;

    --设置/重置初始图形的位置;如果有一个位置返回为真;

    void SetLocation(const Handle(AIS_InteractiveObject)& aniobj,const TopLoc_Location& aLocation) ;

    void ResetLocation(const Handle(AIS_InteractiveObject)& aniobj) ;

    Standard_Boolean HasLocation(const Handle(AIS_InteractiveObject)& aniobj) const;

    得到实体对象的位置;

    const TopLoc_Location& Location(const Handle(AIS_InteractiveObject)& aniobj) const;

    --改变当前面的模式;缺省模式是Aspect_TOFM_TWO_SIDE。意味着属性在前面和后面都应用;

    void SetCurrentFacingModel(const Handle(AIS_InteractiveObject)& aniobj,const Aspect_TypeOfFacingModel aModel =

    Aspect_TOFM_BOTH_SIDE) ;

    --设置/获得三角形的尺寸,缺省值是100mm.

    void SetTrihedronSize(const Standard_Real aSize,const Standard_Boolean updateviewer = Standard_True) ;

    Standard_Real TrihedronSize() const;

    --设置/获取平面的尺寸:

    Standard_EXPORT  void SetPlaneSize(const Standard_Real aSizeX,const Standard_Real aSizeY,const Standard_Boolean

    updateviewer = Standard_True) ;

    --得到实体对象的显示状态;

    AIS_DisplayStatus DisplayStatus(const Handle(AIS_InteractiveObject)& anIobj) const;

    --得到实体对象的显示模式的列表:

    const TColStd_ListOfInteger& DisplayedModes(const Handle(AIS_InteractiveObject)& aniobj) const;

    --关于绘制隐藏线相关的一些函数,通过名称就可以知道函数的意思;

    EnableDrawHiddenLine();

    DisableDrawHiddenLine();

    Standard_Boolean DrawHiddenLine();

    --设置/得到UV等高参数;等高参数是否可用;

    Standard_Integer IsoNumber(const AIS_TypeOfIso WhichIsos = AIS_TOI_Both) ;

    --设置/添加/移除当前对象.....

    InitCurrent() ;MoreCurrent();NextCurrent();

    Standard_Boolean IsCurrent(const Handle(AIS_InteractiveObject)& aniobj) const;

    Handle_AIS_InteractiveObject Current() const;

    Handle_AIS_InteractiveObject FirstCurrentObject() ;

    void HilightCurrents(const Standard_Boolean updateviewer = Standard_True) ;

    void UnhilightCurrents(const Standard_Boolean updateviewer = Standard_True) ;

    void ClearCurrents(const Standard_Boolean updateviewer = Standard_True) ;

  • 相关阅读:
    flink源码阅读(概览)
    idea如何设置home目录
    博客园定制化从入门到精通
    CAP理论的理解
    几个常用的profiler工具对比jprofiler、vituralVM、yourkit、JVM profler
    kafka的使用经验
    netty高并发框架
    Mysql Explain 详解
    show engine innodb status解读
    Class.getResourceAsStream()与ClassLoader.getResourceAsStream()的区别
  • 原文地址:https://www.cnblogs.com/yaoyu126/p/6222934.html
Copyright © 2011-2022 走看看