View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032043 | Community | OCCT:Visualization | public | 2021-01-08 05:32 | 2021-02-15 13:43 |
Reporter | xuweibin | Assigned To | bugmaster | ||
Priority | normal | Severity | just a question | ||
Status | closed | Resolution | no change required | ||
Platform | Windows | OS | VC++ 2013 | ||
Product Version | 7.5.0 | ||||
Target Version | 7.6.0 | ||||
Summary | 0032043: How to set a shape to disable zoom? | ||||
Description | My code like below: TopoDS_Shape box = BRepPrimAPI_MakeBox(gp_Pnt(300,0,0),gp_Pnt(400,100,100)); Handle(AIS_Shape) ais = new AIS_Shape(box); Handle(Graphic3d_TransformPers) theTrsfPers = new Graphic3d_TransformPers(Graphic3d_TransModeFlags::Graphic3d_TMF_ZoomPers,gp_Pnt(300,0,0)); mycontext->Display(ais,true); I want to disable zoom the box at point(300,0,0);The result is not what I want. This is a mistake?Or how can I do to solve this problem? | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
What do you mean result is not what do you expect? If you expect box being non-zoomable from it's center, you would want to defining it's coordinate system appropriately (e.g. the box itself should be defined relative to 0,0,0, not anchor point 300,0,0 - the latter should be passed to transformation persistence parameters). pload MODELING VISUALIZATION vinit View1 box b -200 -50 -50 400 100 100 vdisplay -dispMode 0 b -trsfPers zoom -trsfPersPos 300 0 0 vtrihedron t -origin 300 0 0 |
|
I do not understand. My box is MakeBox(gp_Pnt(300,0,0),gp_Pnt(400,100,100)) Do you mean I should set the anchor point at the box's center point(50,50,50)? pload MODELING VISUALIZATION vinit View1 box b 300 0 0 400 100 100 vdisplay -dispMode 0 b -trsfPers zoom -trsfPersPos 50 50 50 vtrihedron t -origin 50 0 0 The result is not non-zoomable at point(50,50,50). How can i do? |
|
> My box is MakeBox(gp_Pnt(300,0,0),gp_Pnt(400,100,100)) You are creating a box from 2 points, so that it is of size 100x100x100 and with center (350,50,50) within coordinate system having origin in (0,0,0). Then you are telling it to be non-zoomable at some point; start with anchor point (0,0,0) to see how it works - you will see that anchor point defines the new location of box's coordinate system, not box's center. To make it visible you can display a TopoDS_Compound containing your box and TopoDS_Vertex created from (0,0,0) point. pload MODELING VISUALIZATION box b -min 300 0 0 -max 400 100 100 vertex v 0 0 0 compound b v c vdisplay -dispMode 0 c -trsfPers zoom -trsfPersPos 300 0 0 vtrihedron t -origin 300 0 0 If you would like box to be non-zoomable from it's center, then you should define the box in the way so that it's center will be (0,0,0) point - like MakeBox(gp_Pnt(-50,-50,-50),gp_Pnt(50,50,50)). pload MODELING VISUALIZATION box b -min -50 -50 -50 -max 50 50 50 vertex v 0 0 0 compound b v c vdisplay -dispMode 0 c -trsfPers zoom -trsfPersPos 300 0 0 vtrihedron t -origin 300 0 0 |
|
I test and see the result. The method is not what I want; If I want to disable zoon a box at its center,and the center of box is not point(0,0,0).How can I do to realize needs? |
|
> If I want to disable zoon a box at its center,and the center of box is not point(0,0,0). How can I do to realize needs? You need either redefine the box or modify it's coordinate system (AIS_InteractiveObject::SetLocalTransformation()/AIS_InteractiveContext::SetLocation() or apply TopLoc_Location to TopoDS_Shape). pload MODELING VISUALIZATION box b -min 300 0 0 -max 400 100 100 vertex v 0 0 0 compound b v c vdisplay -dispMode 0 c -trsfPers zoom -trsfPersPos 300 0 0 vlocation c -location -350 -50 -50 vtrihedron t -origin 300 0 0 |
|
Thank you!I got it! |
|
Dear bugmaster, please close this issue. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-08 05:32 | xuweibin | New Issue | |
2021-01-08 05:32 | xuweibin | Assigned To | => kgv |
2021-01-08 13:05 | kgv | Note Added: 0098015 | |
2021-01-08 13:05 | kgv | Assigned To | kgv => xuweibin |
2021-01-08 13:05 | kgv | Severity | minor => just a question |
2021-01-08 13:05 | kgv | Status | new => feedback |
2021-01-08 13:05 | kgv | Resolution | open => no change required |
2021-01-08 13:05 | kgv | Target Version | => 7.6.0 |
2021-01-11 06:05 | xuweibin | Note Added: 0098041 | |
2021-01-11 08:27 | kgv | Note Added: 0098042 | |
2021-01-11 09:16 | xuweibin | Note Added: 0098043 | |
2021-01-11 09:55 | kgv | Note Added: 0098045 | |
2021-01-11 09:55 | kgv | Note Edited: 0098045 | |
2021-01-11 11:32 | xuweibin | Note Added: 0098046 | |
2021-01-11 11:35 | kgv | Note Added: 0098047 | |
2021-01-11 11:35 | kgv | Assigned To | xuweibin => bugmaster |
2021-02-15 13:43 | bugmaster | Status | feedback => closed |