View Issue Details

IDProjectCategoryView StatusLast Update
0026840CommunityOCCT:Visualizationpublic2016-11-19 08:44
ReporterVico Liang Assigned Tobugmaster  
PrioritylowSeverityfeature 
Status closedResolutionno change required 
Summary0026840: OCCT Visulazation doesn't support un-scalable solid arrow.
DescriptionIn most cases, the user expected arrow is drawn as solid and also the size should not scale by camera zooming. The two images attached will show the differences.
TagsNo tags attached.
Test case number

Attached Files

  • OCCTArrow.png (15,061 bytes)
  • ExpectedArrow.png (2,729 bytes)
  • arrow_1.png (19,092 bytes)
  • arrow_2.png (20,735 bytes)

Relationships

related to 0027919 closedbugmaster Open CASCADE Visualization - support multiple transformation persistence groups within single presentation 

Activities

Vico Liang

2015-11-05 05:19

developer  

OCCTArrow.png (15,061 bytes)

Vico Liang

2015-11-05 05:19

developer  

ExpectedArrow.png (2,729 bytes)

kgv

2015-11-05 10:09

developer   ~0047782

Last edited: 2015-11-05 10:09

Dear Vico,

the bug description is too imprecise - "OCCT Visualization" provides all capabilities needed to draw 2D arrows with zoom-persistent tips, and many applications already do that.

If you are missing some options for specific presentation class (e.g. within predefined list of interactive objects in package AIS) - please at least name it.

Vico Liang

2015-11-05 10:33

developer   ~0047783

Dear kgv,

What i need is arrows in 3d space not just in 2d. I have tried with zoom-persistent in 3d space but the result is incorrect.

Let me describe my requirements more clearly.
I want to draw an arrow start from gp_Pnt(0,0,0) to gp_Pnt(10, 10, 10). And then i create the arrow with options Prs3d_ArrowAspect to specify the arrow size. Plese see the code of below:
void MyRendering_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr, const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode)
{
    // Set style for arrow
    Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();

    // Draw Line
    Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
    aPrims->AddVertex(myStartPnt);
    aPrims->AddVertex(myEndPnt);
    Prs3d_Root::CurrentGroup(thePresentation)->SetPrimitivesAspect(myDrawer->LineAspect()->Aspect());
    Prs3d_Root::CurrentGroup(thePresentation)->AddPrimitiveArray(aPrims);

    // Draw arrow
    Prs3d_Arrow::Draw(thePresentation, myEndPnt, gp_Dir(gp_Vec(myStartPnt, myEndPnt)), anArrowAspect->Angle(), anArrowAspect->Length());
}

Usage as below:
    Handle(MyRendering_Direction) aDirection = new MyRendering_Direction(aP1, aP2);
    Handle(Prs3d_LineAspect) aLineAttrib = new Prs3d_LineAspect(Quantity_NOC_RED, Aspect_TOL_SOLID, 6.0);
    aDirection->SetTransformPersistence(Graphic3d_TMF_ZoomPers);
    aDirection->Attributes()->SetLineAspect(aLineAttrib);

The generated arrow's two ends will even not changes during zooming. This is not my expected. I hope that the arrow's two ends still keep touch the same 3d points aP1 and aP2.

Vico Liang

2015-11-05 10:38

developer   ~0047784

The "Solid" arrow might be composed of a solid cylinder and a solid cone.

Vico Liang

2015-11-05 10:42

developer   ~0047785

The pixel radius of the cylinder and cone size should not be changed during zooming.

Vico Liang

2015-11-05 10:44

developer   ~0047786

I don't think "OCCT Visualization" have such capability to do that.

kgv

2015-11-05 11:17

developer   ~0047795

Last edited: 2015-11-05 11:18

    aDirection->SetTransformPersistence(Graphic3d_TMF_ZoomPers);

your code does not define anchor point for transformation persistence:
  //! Sets up Transform Persistence Mode for this object.
  //! This function used to lock in object position, rotation and /
  //! or zooming relative to camera position.
  //! Object will be drawn in the origin setted by APoint parameter
  ...
  void SetTransformPersistence (const Graphic3d_TransModeFlags& aFlag,
                                const gp_Pnt& APoint);

The presentation itself should be defined in local reference system related to anchor point.

    Handle(MyRendering_Direction) aDirection = new MyRendering_Direction(aP1, aP2);

if I'm not wrong, you are trying to create a single presentation object which you are expecting should combine zoom-persistent (arrow tip) and normal (line segment) parts.
This can be done by connecting interactive objects or graphic3d structures.

Vico Liang

2015-11-05 16:29

developer   ~0047841

Dear kgv,

Your understanding is exact. Would you please describe how to do that by connecting interactive objects or graphic3d structures? I can't find any hint in the entire OCCT source codes.

kgv

2016-05-23 16:05

developer   ~0054298

The following Draw Harness script shows the idea how such presentations can be defined:
pload MODELING VISUALIZATION
vclear
vinit View1
box b1 -1 0 0 1 2 3
box b2  1 0 0 1 2 3
vdisplay -dispMode 1 b1 b2
vfit
vdrawparray l segments v 0 0 0 v 1 0 0
vdrawparray a triangles v -30 -10 0 v -30 10 0 v 0 0 0
vdisplay a -trsfPers zoom -trsfPersPos 1 0 0
vconnect aa 0 0 0 a l
verase a l

kgv

2016-05-23 16:06

developer  

arrow_1.png (19,092 bytes)

kgv

2016-05-23 16:06

developer  

arrow_2.png (20,735 bytes)

Vico Liang

2016-05-24 05:09

developer   ~0054319

Dear kgv, It's cool. I understand it now. I appriciate your kindly help. Please close this issue.

Issue History

Date Modified Username Field Change
2015-11-05 05:19 Vico Liang New Issue
2015-11-05 05:19 Vico Liang Assigned To => kgv
2015-11-05 05:19 Vico Liang File Added: OCCTArrow.png
2015-11-05 05:19 Vico Liang File Added: ExpectedArrow.png
2015-11-05 10:09 kgv Note Added: 0047782
2015-11-05 10:09 kgv Assigned To kgv => Vico Liang
2015-11-05 10:09 kgv Status new => feedback
2015-11-05 10:09 kgv Note Edited: 0047782
2015-11-05 10:10 kgv Priority normal => low
2015-11-05 10:10 kgv Severity minor => feature
2015-11-05 10:10 kgv Target Version 7.0.0 => 7.1.0
2015-11-05 10:33 Vico Liang Note Added: 0047783
2015-11-05 10:35 Vico Liang Assigned To Vico Liang => kgv
2015-11-05 10:38 Vico Liang Note Added: 0047784
2015-11-05 10:42 Vico Liang Note Added: 0047785
2015-11-05 10:44 Vico Liang Note Added: 0047786
2015-11-05 11:17 kgv Note Added: 0047795
2015-11-05 11:17 kgv Note Edited: 0047795
2015-11-05 11:18 kgv Note Edited: 0047795
2015-11-05 16:29 Vico Liang Note Added: 0047841
2015-11-06 10:12 Vico Liang Status feedback => assigned
2016-05-23 16:05 kgv Note Added: 0054298
2016-05-23 16:05 kgv Assigned To kgv => Vico Liang
2016-05-23 16:05 kgv Status assigned => feedback
2016-05-23 16:05 kgv Resolution open => no change required
2016-05-23 16:06 kgv File Added: arrow_1.png
2016-05-23 16:06 kgv File Added: arrow_2.png
2016-05-24 05:09 Vico Liang Note Added: 0054319
2016-05-24 05:09 Vico Liang Assigned To Vico Liang => kgv
2016-05-24 08:29 kgv Assigned To kgv => bugmaster
2016-05-24 08:29 kgv Target Version 7.1.0 =>
2016-05-24 11:16 bugmaster Status feedback => closed
2016-11-19 08:44 kgv Relationship added related to 0027919