mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 01:58:36 +05:00
0019882: EDF 453 GEOM: Impossible to change the iso values in the VTK window
This commit is contained in:
parent
09e9d9d991
commit
5ce415581c
@ -469,31 +469,42 @@ void GEOMToolsGUI::OnNbIsos()
|
|||||||
aSelMgr->selectedObjects( selected );
|
aSelMgr->selectedObjects( selected );
|
||||||
if ( selected.IsEmpty() )
|
if ( selected.IsEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) FirstIOS = selected.First();
|
|
||||||
if ( FirstIOS.IsNull() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
||||||
if ( !vtkVW )
|
if ( !vtkVW )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SALOME_View* view = GEOM_Displayer::GetActiveView();
|
||||||
|
|
||||||
|
vtkActorCollection* aCollection = vtkActorCollection::New();
|
||||||
|
|
||||||
SVTK_View* aView = vtkVW->getView();
|
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
|
||||||
vtkActorCollection* aCollection = aView->getRenderer()->GetActors();
|
Handle(SALOME_InteractiveObject) anIObject = It.Value();
|
||||||
|
SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
|
||||||
|
SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
|
||||||
|
if ( vtkPrs ) {
|
||||||
|
vtkActorCollection* anActors = vtkPrs->GetObjects();
|
||||||
|
anActors->InitTraversal();
|
||||||
|
vtkActor* anAct = anActors->GetNextActor();
|
||||||
|
aCollection->AddItem(anAct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(aCollection)
|
||||||
|
aCollection->InitTraversal();
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
int UIso = 0;
|
int UIso = 0;
|
||||||
int VIso = 0;
|
int VIso = 0;
|
||||||
if(aCollection){
|
|
||||||
aCollection->InitTraversal();
|
|
||||||
}
|
|
||||||
|
|
||||||
vtkActor *anAct = aCollection->GetNextActor();
|
vtkActor* anAct = aCollection->GetNextActor();
|
||||||
if(GEOM_Actor *anActor = dynamic_cast<GEOM_Actor*>(anAct)){
|
if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
|
||||||
anActor->GetNbIsos(UIso,VIso);
|
anActor->GetNbIsos(UIso,VIso);
|
||||||
}
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMToolsGUI_NbIsosDlg* NbIsosDlg =
|
||||||
GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
|
|
||||||
new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
|
new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
|
||||||
|
|
||||||
NbIsosDlg->setU( UIso );
|
NbIsosDlg->setU( UIso );
|
||||||
@ -502,14 +513,15 @@ void GEOMToolsGUI::OnNbIsos()
|
|||||||
if ( NbIsosDlg->exec() ) {
|
if ( NbIsosDlg->exec() ) {
|
||||||
SUIT_OverrideCursor();
|
SUIT_OverrideCursor();
|
||||||
|
|
||||||
while(anAct = aCollection->GetNextActor()) {
|
while( anAct!=NULL ) {
|
||||||
if(GEOM_Actor *anActor = dynamic_cast<GEOM_Actor*>(anAct)){
|
if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
|
||||||
// There are no casting to needed actor.
|
// There are no casting to needed actor.
|
||||||
UIso = NbIsosDlg->getU();
|
UIso = NbIsosDlg->getU();
|
||||||
VIso = NbIsosDlg->getV();
|
VIso = NbIsosDlg->getV();
|
||||||
int aIsos[2]={UIso,VIso};
|
int aIsos[2]={UIso,VIso};
|
||||||
anActor->SetNbIsos(aIsos);
|
anActor->SetNbIsos(aIsos);
|
||||||
}
|
}
|
||||||
|
anAct = aCollection->GetNextActor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end vtkviewer
|
} // end vtkviewer
|
||||||
|
@ -67,6 +67,8 @@
|
|||||||
#include <vtkMath.h>
|
#include <vtkMath.h>
|
||||||
#include <vtkCamera.h>
|
#include <vtkCamera.h>
|
||||||
|
|
||||||
|
#include "utilities.h"
|
||||||
|
|
||||||
//vtkStandardNewMacro(GEOM_Actor);
|
//vtkStandardNewMacro(GEOM_Actor);
|
||||||
|
|
||||||
#ifndef MYDEBUG
|
#ifndef MYDEBUG
|
||||||
@ -105,7 +107,7 @@ GEOM_Actor::GEOM_Actor():
|
|||||||
|
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout <<this<< " GEOM_Actor::GEOM_Actor"<<endl;
|
MESSAGE (this<< " GEOM_Actor::GEOM_Actor");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
myPolyDataMapper->SetInput(myAppendFilter->GetOutput());
|
myPolyDataMapper->SetInput(myAppendFilter->GetOutput());
|
||||||
@ -180,7 +182,7 @@ GEOM_Actor::GEOM_Actor():
|
|||||||
GEOM_Actor::~GEOM_Actor()
|
GEOM_Actor::~GEOM_Actor()
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout <<this<< " ~GEOM_Actor::GEOM_Actor"<<endl;
|
MESSAGE (this<< " ~GEOM_Actor::GEOM_Actor");
|
||||||
#endif
|
#endif
|
||||||
myHighlightProp->Delete();
|
myHighlightProp->Delete();
|
||||||
myPreHighlightProp->Delete();
|
myPreHighlightProp->Delete();
|
||||||
@ -199,7 +201,7 @@ New()
|
|||||||
|
|
||||||
void Write(vtkPolyData* theDataSet, const char* theFileName){
|
void Write(vtkPolyData* theDataSet, const char* theFileName){
|
||||||
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
|
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
|
||||||
cout<<"Write - "<<theFileName<<"' : "<<theDataSet->GetNumberOfPoints()<<"; "<<theDataSet->GetNumberOfCells()<<endl;
|
MESSAGE ("Write - "<<theFileName<<"' : "<<theDataSet->GetNumberOfPoints()<<"; "<<theDataSet->GetNumberOfCells());
|
||||||
aWriter->SetInput(theDataSet);
|
aWriter->SetInput(theDataSet);
|
||||||
aWriter->SetFileName(theFileName);
|
aWriter->SetFileName(theFileName);
|
||||||
//aWriter->Write();
|
//aWriter->Write();
|
||||||
@ -275,7 +277,7 @@ GEOM_Actor::
|
|||||||
setDisplayMode(int theMode)
|
setDisplayMode(int theMode)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SetDisplayMode = "<<theMode <<endl;
|
MESSAGE ( "GEOM_Actor::SetDisplayMode = "<<theMode );
|
||||||
#endif
|
#endif
|
||||||
VTKViewer_Actor::setDisplayMode(theMode);
|
VTKViewer_Actor::setDisplayMode(theMode);
|
||||||
SetVisibility(GetVisibility());
|
SetVisibility(GetVisibility());
|
||||||
@ -286,7 +288,7 @@ GEOM_Actor::
|
|||||||
SetSelected(bool theIsSelected)
|
SetSelected(bool theIsSelected)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SetSelected = "<<theIsSelected <<endl;
|
MESSAGE ( "GEOM_Actor::SetSelected = "<<theIsSelected );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
myIsSelected = theIsSelected;
|
myIsSelected = theIsSelected;
|
||||||
@ -298,8 +300,8 @@ GEOM_Actor::
|
|||||||
SetVisibility(int theVisibility)
|
SetVisibility(int theVisibility)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SetVisibility = "<<theVisibility <<" myIsSelected="<< myIsSelected
|
MESSAGE ( "GEOM_Actor::SetVisibility = "<<theVisibility <<" myIsSelected="<< myIsSelected
|
||||||
<< " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected<<endl;
|
<< " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SALOME_Actor::SetVisibility(theVisibility);
|
SALOME_Actor::SetVisibility(theVisibility);
|
||||||
@ -313,7 +315,8 @@ SetVisibility(int theVisibility)
|
|||||||
myOneFaceEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
|
myOneFaceEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
|
||||||
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
|
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
|
||||||
|
|
||||||
myVertexActor->SetVisibility(false);// must be added new mode points
|
// myVertexActor->SetVisibility(false);// must be added new mode points
|
||||||
|
myVertexActor->SetVisibility(theVisibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -321,16 +324,14 @@ void
|
|||||||
GEOM_Actor
|
GEOM_Actor
|
||||||
::SetNbIsos(const int theNb[2])
|
::SetNbIsos(const int theNb[2])
|
||||||
{
|
{
|
||||||
myNbIsos[0] = theNb[0];
|
myWireframeFaceSource->SetNbIso(theNb);
|
||||||
myNbIsos[1] = theNb[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GEOM_Actor
|
GEOM_Actor
|
||||||
::GetNbIsos(int &theNbU,int &theNbV)
|
::GetNbIsos(int &theNbU,int &theNbV)
|
||||||
{
|
{
|
||||||
theNbU = myNbIsos[0];
|
myWireframeFaceSource->GetNbIso(theNbU, theNbV);
|
||||||
theNbV = myNbIsos[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -465,7 +466,7 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
|||||||
// OLD METHODS
|
// OLD METHODS
|
||||||
void GEOM_Actor::setDeflection(double adef) {
|
void GEOM_Actor::setDeflection(double adef) {
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::setDeflection"<<endl;
|
MESSAGE ( "GEOM_Actor::setDeflection" );
|
||||||
#endif
|
#endif
|
||||||
SetDeflection((float)adef,GetIsRelative());
|
SetDeflection((float)adef,GetIsRelative());
|
||||||
}
|
}
|
||||||
@ -479,7 +480,7 @@ void GEOM_Actor::setDeflection(double adef) {
|
|||||||
void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop)
|
void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SetHighlightProperty"<<endl;
|
MESSAGE ( "GEOM_Actor::SetHighlightProperty" );
|
||||||
#endif
|
#endif
|
||||||
this->myHighlightActor->GetProperty()->DeepCopy(Prop);
|
this->myHighlightActor->GetProperty()->DeepCopy(Prop);
|
||||||
|
|
||||||
@ -488,7 +489,7 @@ void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop)
|
|||||||
void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop)
|
void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << this << " GEOM_Actor::SetWireframeProperty"<<endl;
|
MESSAGE ( this << " GEOM_Actor::SetWireframeProperty" );
|
||||||
#endif
|
#endif
|
||||||
// must be filled
|
// must be filled
|
||||||
myWireframeFaceActor->SetProperty(Prop);
|
myWireframeFaceActor->SetProperty(Prop);
|
||||||
@ -497,7 +498,7 @@ void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop)
|
|||||||
void GEOM_Actor::SetShadingProperty(vtkProperty* Prop)
|
void GEOM_Actor::SetShadingProperty(vtkProperty* Prop)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SetShadingProperty"<<endl;
|
MESSAGE ( "GEOM_Actor::SetShadingProperty" );
|
||||||
#endif
|
#endif
|
||||||
myShadingFaceProp->DeepCopy(Prop);
|
myShadingFaceProp->DeepCopy(Prop);
|
||||||
}
|
}
|
||||||
@ -506,7 +507,7 @@ void GEOM_Actor::SetShadingProperty(vtkProperty* Prop)
|
|||||||
void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper)
|
void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::Render"<<endl;
|
MESSAGE ( "GEOM_Actor::Render" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!GetVisibility())
|
if(!GetVisibility())
|
||||||
@ -578,7 +579,7 @@ void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper)
|
|||||||
void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
|
void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::ReleaseGraphicsResources"<<endl;
|
MESSAGE ( "GEOM_Actor::ReleaseGraphicsResources" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +588,7 @@ void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
|
|||||||
void GEOM_Actor::ShallowCopy(vtkProp *prop)
|
void GEOM_Actor::ShallowCopy(vtkProp *prop)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::ShallowCopy"<<endl;
|
MESSAGE ( "GEOM_Actor::ShallowCopy" );
|
||||||
#endif
|
#endif
|
||||||
GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
|
GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
|
||||||
if ( f != NULL )
|
if ( f != NULL )
|
||||||
@ -601,7 +602,7 @@ void GEOM_Actor::ShallowCopy(vtkProp *prop)
|
|||||||
|
|
||||||
const TopoDS_Shape& GEOM_Actor::getTopo() {
|
const TopoDS_Shape& GEOM_Actor::getTopo() {
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::getTopo"<<endl;
|
MESSAGE ( "GEOM_Actor::getTopo" );
|
||||||
#endif
|
#endif
|
||||||
return myShape;
|
return myShape;
|
||||||
}
|
}
|
||||||
@ -610,14 +611,14 @@ void GEOM_Actor::setInputShape(const TopoDS_Shape& ashape, double adef1,
|
|||||||
int imode, bool isVector)
|
int imode, bool isVector)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::setInputShape"<<endl;
|
MESSAGE ( "GEOM_Actor::setInputShape" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
double GEOM_Actor::getDeflection()
|
double GEOM_Actor::getDeflection()
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::getDeflection"<<endl;
|
MESSAGE ( "GEOM_Actor::getDeflection" );
|
||||||
#endif
|
#endif
|
||||||
return (double) GetDeflection();
|
return (double) GetDeflection();
|
||||||
}
|
}
|
||||||
@ -626,7 +627,7 @@ double GEOM_Actor::getDeflection()
|
|||||||
double GEOM_Actor::isVector()
|
double GEOM_Actor::isVector()
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::isVector"<<endl;
|
MESSAGE ( "GEOM_Actor::isVector" );
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -634,21 +635,21 @@ double GEOM_Actor::isVector()
|
|||||||
void GEOM_Actor::SubShapeOn()
|
void GEOM_Actor::SubShapeOn()
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SubShapeOn"<<endl;
|
MESSAGE ( "GEOM_Actor::SubShapeOn" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_Actor::SubShapeOff()
|
void GEOM_Actor::SubShapeOff()
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << "GEOM_Actor::SubShapeOff"<<endl;
|
MESSAGE ( "GEOM_Actor::SubShapeOff" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_Actor::highlight(bool highlight)
|
void GEOM_Actor::highlight(bool highlight)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << this << " GEOM_Actor::highlight highlight="<<highlight<<endl;
|
MESSAGE ( this << " GEOM_Actor::highlight highlight="<<highlight );
|
||||||
#endif
|
#endif
|
||||||
SALOME_Actor::highlight(highlight);
|
SALOME_Actor::highlight(highlight);
|
||||||
}
|
}
|
||||||
@ -701,7 +702,7 @@ GEOM_Actor
|
|||||||
{
|
{
|
||||||
myIsSelected = theIsHighlight;
|
myIsSelected = theIsHighlight;
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected<<endl;
|
MESSAGE ( this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
|
SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
|
||||||
@ -718,7 +719,7 @@ GEOM_Actor
|
|||||||
bool theIsHighlight)
|
bool theIsHighlight)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << this<<" GEOM_Actor::PreHighlight (3) theIsHighlight="<<theIsHighlight<<endl;
|
MESSAGE ( this<<" GEOM_Actor::PreHighlight (3) theIsHighlight="<<theIsHighlight );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !GetPickable() )
|
if ( !GetPickable() )
|
||||||
@ -763,7 +764,7 @@ GEOM_Actor
|
|||||||
{
|
{
|
||||||
// define the selection of object
|
// define the selection of object
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
cout << endl << this << " GEOM_Actor::Highlight (3) myIsSelected="<<myIsSelected<<endl;
|
MESSAGE ( std::endl << this << " GEOM_Actor::Highlight (3) myIsSelected="<<myIsSelected );
|
||||||
#endif
|
#endif
|
||||||
bool aRet = SALOME_Actor::Highlight(theInteractorStyle,theSelectionEvent,theIsHighlight);
|
bool aRet = SALOME_Actor::Highlight(theInteractorStyle,theSelectionEvent,theIsHighlight);
|
||||||
SetSelected(theIsHighlight);
|
SetSelected(theIsHighlight);
|
||||||
|
@ -32,9 +32,10 @@
|
|||||||
vtkStandardNewMacro(GEOM_WireframeFace);
|
vtkStandardNewMacro(GEOM_WireframeFace);
|
||||||
|
|
||||||
GEOM_WireframeFace::GEOM_WireframeFace():
|
GEOM_WireframeFace::GEOM_WireframeFace():
|
||||||
NbIso(1),
|
Discret(15)
|
||||||
Discret(15)
|
|
||||||
{
|
{
|
||||||
|
NbIso[0] = 1;
|
||||||
|
NbIso[1] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
GEOM_WireframeFace::~GEOM_WireframeFace()
|
GEOM_WireframeFace::~GEOM_WireframeFace()
|
||||||
@ -58,12 +59,29 @@ Execute()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GEOM_WireframeFace::SetNbIso(const int theNb[2])
|
||||||
|
{
|
||||||
|
if ( theNb[0] == NbIso[0] && theNb[1] == NbIso[1])
|
||||||
|
return;
|
||||||
|
|
||||||
|
NbIso[0] = theNb[0];
|
||||||
|
NbIso[1] = theNb[1];
|
||||||
|
|
||||||
|
Modified();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GEOM_WireframeFace::GetNbIso(int &theNbU,int &theNbV)
|
||||||
|
{
|
||||||
|
theNbU = NbIso[0];
|
||||||
|
theNbV = NbIso[1];
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GEOM_WireframeFace::
|
GEOM_WireframeFace::
|
||||||
OCC2VTK(const TopoDS_Face& theFace,
|
OCC2VTK(const TopoDS_Face& theFace,
|
||||||
vtkPolyData* thePolyData,
|
vtkPolyData* thePolyData,
|
||||||
vtkPoints* thePts,
|
vtkPoints* thePts,
|
||||||
const int theNbIso,
|
const int theNbIso[2],
|
||||||
const int theDiscret)
|
const int theDiscret)
|
||||||
{
|
{
|
||||||
TopoDS_Face aFace = theFace;
|
TopoDS_Face aFace = theFace;
|
||||||
@ -74,7 +92,7 @@ OCC2VTK(const TopoDS_Face& theFace,
|
|||||||
void
|
void
|
||||||
GEOM_WireframeFace::
|
GEOM_WireframeFace::
|
||||||
CreateIso(const TopoDS_Face& theFace,
|
CreateIso(const TopoDS_Face& theFace,
|
||||||
const int theNbIso,
|
const int theNbIso[2],
|
||||||
const int theDiscret,
|
const int theDiscret,
|
||||||
vtkPolyData* thePolyData,
|
vtkPolyData* thePolyData,
|
||||||
vtkPoints* thePts)
|
vtkPoints* thePts)
|
||||||
@ -95,8 +113,8 @@ CreateIso(const TopoDS_Face& theFace,
|
|||||||
Standard_False);
|
Standard_False);
|
||||||
|
|
||||||
Standard_Real anUMin, anUMax, aVMin, aVMax;
|
Standard_Real anUMin, anUMax, aVMin, aVMax;
|
||||||
TColStd_Array1OfReal anUPrm(1, theNbIso), aVPrm(1, theNbIso);
|
TColStd_Array1OfReal anUPrm(1, theNbIso[0]), aVPrm(1, theNbIso[1]);
|
||||||
TColStd_Array1OfInteger anUInd(1, theNbIso), aVInd(1, theNbIso);
|
TColStd_Array1OfInteger anUInd(1, theNbIso[0]), aVInd(1, theNbIso[1]);
|
||||||
|
|
||||||
anUInd.Init(0);
|
anUInd.Init(0);
|
||||||
aVInd.Init(0);
|
aVInd.Init(0);
|
||||||
@ -185,11 +203,11 @@ CreateIso(const TopoDS_Face& theFace,
|
|||||||
Standard_Real confusion = Min(DeltaU, DeltaV) * HATHCER_CONFUSION_3D ;
|
Standard_Real confusion = Min(DeltaU, DeltaV) * HATHCER_CONFUSION_3D ;
|
||||||
aHatcher.Confusion3d (confusion) ;
|
aHatcher.Confusion3d (confusion) ;
|
||||||
|
|
||||||
Standard_Real StepU = DeltaU / (Standard_Real)theNbIso;
|
Standard_Real StepU = DeltaU / (Standard_Real)theNbIso[0];
|
||||||
if(StepU > confusion){
|
if(StepU > confusion){
|
||||||
Standard_Real UPrm = anUMin + StepU / 2.;
|
Standard_Real UPrm = anUMin + StepU / 2.;
|
||||||
gp_Dir2d Dir(0., 1.) ;
|
gp_Dir2d Dir(0., 1.) ;
|
||||||
for(IIso = 1 ; IIso <= theNbIso ; IIso++) {
|
for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++) {
|
||||||
anUPrm(IIso) = UPrm ;
|
anUPrm(IIso) = UPrm ;
|
||||||
gp_Pnt2d Ori (UPrm, 0.) ;
|
gp_Pnt2d Ori (UPrm, 0.) ;
|
||||||
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
|
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
|
||||||
@ -198,11 +216,11 @@ CreateIso(const TopoDS_Face& theFace,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Real StepV = DeltaV / (Standard_Real) theNbIso ;
|
Standard_Real StepV = DeltaV / (Standard_Real) theNbIso[1] ;
|
||||||
if(StepV > confusion){
|
if(StepV > confusion){
|
||||||
Standard_Real VPrm = aVMin + StepV / 2.;
|
Standard_Real VPrm = aVMin + StepV / 2.;
|
||||||
gp_Dir2d Dir(1., 0.);
|
gp_Dir2d Dir(1., 0.);
|
||||||
for(IIso = 1 ; IIso <= theNbIso ; IIso++){
|
for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){
|
||||||
aVPrm(IIso) = VPrm;
|
aVPrm(IIso) = VPrm;
|
||||||
gp_Pnt2d Ori (0., VPrm);
|
gp_Pnt2d Ori (0., VPrm);
|
||||||
Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir));
|
Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir));
|
||||||
@ -217,9 +235,9 @@ CreateIso(const TopoDS_Face& theFace,
|
|||||||
aHatcher.Trim() ;
|
aHatcher.Trim() ;
|
||||||
|
|
||||||
Standard_Integer aNbDom = 0 ; // for debug purpose
|
Standard_Integer aNbDom = 0 ; // for debug purpose
|
||||||
for(IIso = 1 ; IIso <= theNbIso ; IIso++){
|
Standard_Integer Index ;
|
||||||
Standard_Integer Index ;
|
|
||||||
|
|
||||||
|
for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++){
|
||||||
Index = anUInd(IIso) ;
|
Index = anUInd(IIso) ;
|
||||||
if(Index != 0){
|
if(Index != 0){
|
||||||
if(aHatcher.TrimDone(Index) && !aHatcher.TrimFailed(Index)){
|
if(aHatcher.TrimDone(Index) && !aHatcher.TrimFailed(Index)){
|
||||||
@ -228,7 +246,9 @@ CreateIso(const TopoDS_Face& theFace,
|
|||||||
aNbDom = aHatcher.NbDomains (Index);
|
aNbDom = aHatcher.NbDomains (Index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){
|
||||||
Index = aVInd(IIso);
|
Index = aVInd(IIso);
|
||||||
if(Index != 0){
|
if(Index != 0){
|
||||||
if(aHatcher.TrimDone (Index) && !aHatcher.TrimFailed(Index)){
|
if(aHatcher.TrimDone (Index) && !aHatcher.TrimFailed(Index)){
|
||||||
@ -463,4 +483,4 @@ CreateIso__(const BRepAdaptor_Surface& theSurface,
|
|||||||
CreateIso__(theSurface, theIsoType, aLocalU , theV, theStep/2, thePolyData, thePts);
|
CreateIso__(theSurface, theIsoType, aLocalU , theV, theStep/2, thePolyData, thePts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ public:
|
|||||||
vtkTypeMacro(GEOM_WireframeFace,GEOM_FaceSource);
|
vtkTypeMacro(GEOM_WireframeFace,GEOM_FaceSource);
|
||||||
static GEOM_WireframeFace* New();
|
static GEOM_WireframeFace* New();
|
||||||
|
|
||||||
vtkSetMacro(NbIso,int);
|
/* vtkSetMacro(NbIso,int);
|
||||||
vtkGetMacro(NbIso,int);
|
vtkGetMacro(NbIso,int);*/
|
||||||
|
|
||||||
vtkSetMacro(Discret,int);
|
vtkSetMacro(Discret,int);
|
||||||
vtkGetMacro(Discret,int);
|
vtkGetMacro(Discret,int);
|
||||||
@ -25,16 +25,22 @@ public:
|
|||||||
void OCC2VTK(const TopoDS_Face& theFace,
|
void OCC2VTK(const TopoDS_Face& theFace,
|
||||||
vtkPolyData* thePolyData,
|
vtkPolyData* thePolyData,
|
||||||
vtkPoints* thePts,
|
vtkPoints* thePts,
|
||||||
int theNbIso = 1,
|
const int theNbIso[2],
|
||||||
int theDiscret = 15);
|
const int theDiscret = 15);
|
||||||
|
|
||||||
|
//! IsoLines management
|
||||||
|
// theNb[0] - number of U lines
|
||||||
|
// theNb[1] - number of V lines
|
||||||
|
virtual void SetNbIso(const int theNb[2]);
|
||||||
|
virtual void GetNbIso(int &theNbU,int &theNbV);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int NbIso, Discret;
|
int NbIso[2], Discret;
|
||||||
|
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
CreateIso(const TopoDS_Face& theFace,
|
CreateIso(const TopoDS_Face& theFace,
|
||||||
const int theNbIso,
|
const int theNbIso[2],
|
||||||
const int theDiscret,
|
const int theDiscret,
|
||||||
vtkPolyData* thePolyData,
|
vtkPolyData* thePolyData,
|
||||||
vtkPoints* thePts);
|
vtkPoints* thePts);
|
||||||
|
Loading…
Reference in New Issue
Block a user