Change View Algo (HLRBRep_PolyAlgo,HLRBRep_Algo)

I think V3d_View by default after make SetDegenerateModeOff() use the HLRBRep_PolyAlgo for showing hidden lines.
I want to hide lines. And I think that I'm need to use HLRBRep_Algo.

How I can use this algoritm?
Thanks.

Attachments: 
JuryS's picture

Now I'm playing with HLRBRep_Algo and It's work, but the Result Shape position is not correct !

Here Is my code:

void DocumentCommon::onHideLines()
{
CleanAfterTexture();

Handle_TPrsStd_AISPresentation CurrentPrs;
Handle_TNaming_NamedShape myShape;
TDF_Label LabObject;
AIS_ListOfInteractive aList;
AIS_ListIteratorOfListOfInteractive aListIterator;
TopTools_ListOfShape myListOfShape;

myContext->DisplayedObjects(aList);
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next())
{
CurrentPrs = Handle(TPrsStd_AISPresentation)::DownCast(aListIterator.Value()->GetOwner());
if (CurrentPrs.IsNull()) continue; //Åñëè îáúåêò áåç àòòðèáóòîâ ïðåðûâàþñü
LabObject = CurrentPrs->Label();
if (!LabObject.FindAttribute(TNaming_NamedShape::GetID(),myShape)) continue; //Åñëè íå íàéäåíî òåëî ïðåðûâàþñü
//myContext->SetDisplayMode(CurrentPrs->GetAIS(), 3, Standard_False); //Ïðÿ÷ó îáúåêò
myListOfShape.Append(myShape->Get());
}

if (myListOfShape.IsEmpty()) return;

Handle_HLRBRep_Algo myAlgo = new HLRBRep_Algo();

TopTools_ListIteratorOfListOfShape anIterator(myListOfShape);
for (;anIterator.More();anIterator.Next())
myAlgo->Add(anIterator.Value(),0);

V3d_Coordinate DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz;
Standard_Boolean IsPerspective;

QWorkspace* ws = myApp->getWorkspace();
MDIWindow* w = (MDIWindow*) ws->activeWindow();
View* myView = w->getView();
myView->GetProjData(DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz,IsPerspective);

Quantity_Length aFocus = 1;
Prs3d_Projector aPrs3d_Projector(IsPerspective,aFocus,DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz);

HLRAlgo_Projector myProjector = aPrs3d_Projector.Projector();

myAlgo->Projector(myProjector);

myAlgo->Update();
myAlgo->Hide();

HLRBRep_HLRToShape aHLRToShape(myAlgo);

TopoDS_Shape Shape(aHLRToShape.VCompound());

Handle_AIS_Shape myShapeForHideLine = new AIS_Shape(Shape);
myContext->Display(myShapeForHideLine);

myContext->UpdateCurrentViewer();
}

What the problem with this.. I don't understand.

Attachments: 
JuryS's picture

Also I get my Projection data from V3dView:

myView->Proj(DX,DY,DZ);
myView->At(XAt,YAt,ZAt);
myView->Up(Vx,Vy,Vz);
IsPerspective = (myView->Type() == V3d_PERSPECTIVE);

Maybe It's a V3dView problem ?

JuryS's picture

Hi, Guys ! No any idea how to hide lines ? Maybe this can work without HLR Algo ?
Thanks for your answer.

JuryS's picture

I make this code for 3dView without use 2dView, with rotation and simmetry of the shape from HLRBrep_Algo, after I'm set the original Shape to hide mode and they may selected, and the shape of HLR I make with showing, but not mouse selected....

If anybody need my code write here.
Topic must be closed.