Change Line Type in OpenCascade

在OpenCascade中更改线型-Change Line Type in OpenCascade

eryar@163.com

 

关键字KeyWords:OpenCascade,Line Aspect, Line Type

 

在OpenCascade的显示模块中,可以设置线型、消隐方式和离散精度等属性。这些属性都是在AIS_Drawer中设置。

AIS_Drawer类就是用来管理显示属性的。可以设置如下显示属性:

  • void  SetLineAspect (const Handle< Prs3d_LineAspect > &anAspect)
  • void  SetWireAspect (const Handle< Prs3d_LineAspect > &anAspect)
  • void  SetDeviationCoefficient (const Standard_Real aCoefficient)
  • void  SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)

以为设置线型是用SetLineAspect,结果试了一下,不成功。查找了一下论坛,也有人有同样的问题:

http://www.opencascade.org/org/forum/thread_12589/?forum=3

又搜索了下,发现设置拓朴形状线型的函数是用:SetWireAspect,试验成功!示例程序如下所示:

Handle_AIS_Shape xAxis = new AIS_Shape(BRepBuilderAPI_MakeEdge(gp_Pnt(-5000,0,0), gp_Pnt(5000, 0, 0)));

Handle_Prs3d_LineAspect lineAspect = new Prs3d_LineAspect(Quantity_NOC_WHITE, Aspect_TOL_DOTDASH, 1);

xAxis->Attributes()->SetWireAspect(lineAspect);
myAISContext->Display(xAxis, false);

   

时间: 2024-10-26 19:31:50

Change Line Type in OpenCascade的相关文章

Two analytical 2d line intersection in OpenCASCADE

Two analytical 2d line intersection in OpenCASCADE eryar@163.com Abstract. OpenCASCADE geometric tools provide algorithms to calculate the intersection of two 2d curves, surfaces, or a 3d curve and a surface. Those are the basis of the Boolean Operat

OpenCASCADE Outline

OpenCASCADE Outline eryar@163.com      有网友反映blog中关于OpenCASCADE的文章比较杂乱,不太好找,最好能提供一个大纲,这样方便查找.于是决定将这些学习时写的文章整理下,方便对OpenCASCADE的学习理解.其实在http://www.cnblogs.com/opencascade中,已经将文章按目录重新发表了一遍.可以按OpenCASCADE的模块的顺序来学习,也可以挑选自己感兴趣的部分来学习.      由于本人水平所限,文中的错误不妥之处

15 Examples To Master Linux Command Line History

When you are using Linux command line frequently, using the history effectively can be a major productivity boost. In fact, once you have mastered the 15 examples that I've provided here, you'll find using command line more enjoyable and fun. 1. Disp

利用PocketSOAP链接webservice(2)---VC++

c++|web|链接 psTemp.cpp_______________________// psTemp.cpp : Defines the entry point for the console application.// #include "stdafx.h"#include "resource.h" int _tmain(int argc, LPCTSTR argv[]){    USES_CONVERSION ;     std::cout <&l

VIM用户手册学习1

Remember  that  you  should  be  learning  by  doing, not  memorization. 1.零散的一些东西!a. CTRL-o 回到前一个位置(Notice:Type CTRL-T or CTRL-O <repeat to go further back>)b. 移动光标,按"k"上移,按"j"下移,按"h"左移,按"l"右移.图示如下:          

How to Create a Framework for iOS[RE]

In the previous tutorial, you learned how to create a reusable knob control. However, it might not be obvious how to make it easy for other developers to reuse it. One way to share it would be to provide the source code files directly. However, this

浏览器的工作原理:新式网络浏览器幕后揭秘{转}

//我是 "转"的~这么大牛的文章, 我会慢慢理解和回味~ http://taligarsiel.com/Projects/howbrowserswork1.htm http://www.html5rocks.com/zh/tutorials/internals/howbrowserswork/ 浏览器的渲染原理简介 Introduction The browsers we will talk about The browser's main functionality The bro

Hadoop TDG 3 – MR Job

Anatomy of a MapReduce Job Run   Classic MapReduce (MapReduce 1) A job run in classic MapReduce is illustrated in Figure 6-1. At the highest level, there are four independent entities: • The client, which submits the MapReduce job.  • The jobtracker,

WebKit 框架一瞥(A Look at the WebKit Framework) – Part 1

A Look at the WebKit Framework – Part 1 If you've ever built an application that required a webview to load web content in your native app, then you have probably experienced the frustrations that came with using UIWebView. UIWebView is quite limited