MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026840Community[OCCT] OCCT:Visualizationpublic2015-11-05 05:192016-11-19 08:44
ReporterVico Liang 
Assigned Tobugmaster 
PrioritylowSeverityfeature 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
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 Filespng file icon OCCTArrow.png (15,061 bytes) 2015-11-05 05:19
png file icon ExpectedArrow.png (2,729 bytes) 2015-11-05 05:19
png file icon arrow_1.png (19,092 bytes) 2016-05-23 16:06
png file icon arrow_2.png (20,735 bytes) 2016-05-23 16:06

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

-  Notes
(0047782)
kgv (developer)
2015-11-05 10:09
edited on: 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.

(0047783)
Vico Liang (developer)
2015-11-05 10:33

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.
(0047784)
Vico Liang (developer)
2015-11-05 10:38

The "Solid" arrow might be composed of a solid cylinder and a solid cone.
(0047785)
Vico Liang (developer)
2015-11-05 10:42

The pixel radius of the cylinder and cone size should not be changed during zooming.
(0047786)
Vico Liang (developer)
2015-11-05 10:44

I don't think "OCCT Visualization" have such capability to do that.
(0047795)
kgv (developer)
2015-11-05 11:17
edited on: 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.

(0047841)
Vico Liang (developer)
2015-11-05 16:29

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.
(0054298)
kgv (developer)
2016-05-23 16:05

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
(0054319)
Vico Liang (developer)
2016-05-24 05:09

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 View Revisions
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 View Revisions
2015-11-05 11:18 kgv Note Edited: 0047795 View Revisions
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


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker