Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / Display dynamic (changing) graphics

Display dynamic (changing) graphics

Display dynamic (changing) graphics
Hugues Delorme 2013/02/18 12:14
Hello,

I have to display 3d points that are generated dynamically (anytime some input device is moved).
So I've created a class inheriting AIS_InteractiveObject and redefined Compute(Handle_PrsMgr_PresentationManager3d, Handle_Prs3d_Presentation, ...) method.

This sub-class relies on a Graphic3d_ArrayOfPrimitives being filled with specific purpose addPoint() :

class AIS_Path : public AIS_InteractiveObject
{
public:
AIS_Path(Standard_Integer maxPoints)
: m_points(new Graphic3d_ArrayOfPolylines(maxPoints))
{
}

void addPoint(const gp_Pnt& pnt)
{
m_points->AddVertex(pnt);
}

protected:
void Compute(const Handle_PrsMgr_PresentationManager3d& pm,
const Handle_Prs3d_Presentation& pres,
const Standard_Integer mode)
{
Handle_Graphic3d_Group group = Prs3d_Root::CurrentGroup(pres);
if (group.IsNull())
return;

group->BeginPrimitives();
group->AddPrimitiveArray(m_points);
group->EndPrimitives();
}

void ComputeSelection(const Handle_SelectMgr_Selection& selection, const Standard_Integer mode)
{ }

private:
Handle_Graphic3d_ArrayOfPrimitives m_points;
};


Each time a new point is added AIS_InteractiveContext::RecomputePrsOnly() is called and then Update() but only the points added with addPoint() before the very first call to Display() can be seen, after that nothing is displayed.

How should I proceed to get things work ?
 
 
Latest news
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!
  • Open CASCADE Technology 6.5.4 is available for download!

  • © OPEN CASCADE 2000 - 2013  |  Search  |  Contacts   |  Site map