mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-24 10:47:55 +05:00
Merge with OCC_development_generic_2006
This commit is contained in:
parent
7b45e8210e
commit
96478dfdc2
@ -42,9 +42,7 @@
|
||||
#include "OCCViewer_ViewManager.h"
|
||||
#include "SOCC_ViewModel.h"
|
||||
|
||||
#include "VTKViewer_ViewWindow.h"
|
||||
#include "VTKViewer_ViewModel.h"
|
||||
#include "VTKViewer_RenderWindowInteractor.h"
|
||||
#include "SVTK_ViewModel.h"
|
||||
#include "SVTK_ViewWindow.h"
|
||||
#include "SVTK_View.h"
|
||||
|
||||
@ -98,7 +96,7 @@ inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){
|
||||
|
||||
inline SVTK_ViewWindow* GetSVTKViewWindow(SUIT_Application* theApp){
|
||||
SUIT_ViewWindow* window = theApp->desktop()->activeWindow();
|
||||
if(window && window->getViewManager()->getType() == VTKViewer_Viewer::Type())
|
||||
if(window && window->getViewManager()->getType() == SVTK_Viewer::Type())
|
||||
return dynamic_cast<SVTK_ViewWindow*>( window );
|
||||
|
||||
return 0;
|
||||
@ -135,19 +133,28 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
||||
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
|
||||
|
||||
GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen();
|
||||
if (CORBA::is_nil(Geom)) {
|
||||
GeometryGUI::InitGeomGen();
|
||||
Geom = GeometryGUI::GetGeomGen();
|
||||
}
|
||||
if (CORBA::is_nil(Geom))
|
||||
return;
|
||||
|
||||
string aFatherIOR;
|
||||
_PTR(SComponent) father = aStudy->FindComponent("GEOM");
|
||||
aStudyBuilder->DefineComponentInstance
|
||||
(father, SalomeApp_Application::orb()->object_to_string(Geom));
|
||||
father->ComponentIOR(aFatherIOR);
|
||||
if (!father)
|
||||
return;
|
||||
if (!father->ComponentIOR(aFatherIOR)) {
|
||||
aStudyBuilder->LoadWith(father, SalomeApp_Application::orb()->object_to_string(Geom));
|
||||
father->ComponentIOR(aFatherIOR);
|
||||
}
|
||||
|
||||
_PTR(SObject) obj = aStudy->FindObjectID(myEntry);
|
||||
_PTR(GenericAttribute) anAttr;
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
// Create new actor
|
||||
_PTR(GenericAttribute) anAttr;
|
||||
if (!obj->FindAttribute(anAttr, "AttributeIOR"))
|
||||
return;
|
||||
_PTR(AttributeIOR) anIOR(anAttr);
|
||||
@ -155,7 +162,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
||||
|
||||
GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str());
|
||||
TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape);
|
||||
if (obj) {
|
||||
if (!Shape.IsNull()) {
|
||||
if (obj->FindAttribute(anAttr, "AttributeName")) {
|
||||
_PTR(AttributeName) aName (anAttr);
|
||||
string aNameValue = aName->Value();
|
||||
@ -216,17 +223,17 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
|
||||
{
|
||||
public:
|
||||
TEventUpdateBrowser() {}
|
||||
virtual void Execute() {
|
||||
virtual void Execute() {
|
||||
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
|
||||
if (app) {
|
||||
CAM_Module* module = app->module("Geometry");
|
||||
SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
|
||||
if (appMod) appMod->updateObjBrowser(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ProcessVoidEvent(new TEventUpdateBrowser ());
|
||||
|
||||
ProcessVoidEvent(new TEventUpdateBrowser ());
|
||||
}
|
||||
|
||||
|
||||
|
@ -325,7 +325,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShell
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells
|
||||
(list<Handle(GEOM_Object)> theShapes)
|
||||
{
|
||||
return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolidShells");
|
||||
return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolid");
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -78,13 +78,11 @@ static
|
||||
void RefineSolids(const TopoDS_Shape& ,
|
||||
TopTools_ListOfShape&);
|
||||
|
||||
//modified by NIZNHY-PKV Fri Feb 25 17:19:39 2005f XX
|
||||
static
|
||||
void GetPlanes (const TopoDS_Edge& anEx,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& anEFMapx,
|
||||
const TopoDS_Face& aF1,
|
||||
TopAbs_State& aStPF1);
|
||||
//modified by NIZNHY-PKV Fri Feb 25 17:19:44 2005t XX
|
||||
|
||||
//=======================================================================
|
||||
//function : ShellsAndSolids
|
||||
@ -100,9 +98,8 @@ static
|
||||
myAddedFacesMap.Clear();
|
||||
bMakeSolids=(myLimit==TopAbs_SHAPE || myLimit<TopAbs_SHELL);
|
||||
//
|
||||
//modified by NIZNHY-PKV Thu Feb 24 17:22:32 2005 f XX
|
||||
myInternalFaces.Clear(); // remove it after all modifs
|
||||
//modified by NIZNHY-PKV Thu Feb 24 17:22:56 2005 t XX
|
||||
//
|
||||
aItS.Initialize(myListShapes);
|
||||
for ( ;aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Shape& aS=aItS.Value();
|
||||
@ -164,10 +161,11 @@ void NMTAlgo_Splitter::MakeShells(const TopoDS_Shape& aS,
|
||||
aShellMaker.AddConstFaces(aFC);
|
||||
//
|
||||
// add split faces inside aS
|
||||
TopoDS_Shape aIFC;
|
||||
if (myClosedShapes.Contains(aS)) {
|
||||
//
|
||||
// internal faces compound
|
||||
TopoDS_Shape aIFC=FindFacesInside(aS, Standard_True);
|
||||
aIFC=FindFacesInside(aS, Standard_True);
|
||||
aShellMaker.AddSectionFaces(aIFC);
|
||||
}
|
||||
//
|
||||
@ -177,17 +175,16 @@ void NMTAlgo_Splitter::MakeShells(const TopoDS_Shape& aS,
|
||||
//
|
||||
// Add faces added to new shell to myAddedFacesMap:
|
||||
// avoid rebuilding twice common part of 2 solids.
|
||||
|
||||
TopTools_ListIteratorOfListOfShape itS(aLNS);
|
||||
TopExp_Explorer expF;
|
||||
for (; itS.More(); itS.Next()) {
|
||||
const TopoDS_Shape& aSh=itS.Value();
|
||||
expF.Init (aSh, TopAbs_FACE);
|
||||
for (; expF.More(); expF.Next()){
|
||||
myAddedFacesMap.Add (expF.Current());
|
||||
const TopoDS_Shape& aFx=expF.Current();
|
||||
myAddedFacesMap.Add (aFx);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeSolids
|
||||
@ -320,11 +317,15 @@ void NMTAlgo_Splitter::MakeSolids(const TopoDS_Shape& theSolid,
|
||||
const TopoDS_Shape& CSF = myImageShape.Image(theShape).First();
|
||||
//
|
||||
TopTools_MapOfShape MSE, MFP;
|
||||
//xf
|
||||
TopTools_IndexedMapOfShape aMFCSF;
|
||||
//xt
|
||||
TopTools_DataMapOfShapeListOfShape DMSEFP;
|
||||
TopTools_MapIteratorOfMapOfShape itm;
|
||||
TopTools_ListOfShape EmptyL;
|
||||
TopTools_ListIteratorOfListOfShape itl;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeListOfShape DMEF;
|
||||
//
|
||||
// MSE filling: map of new section edges of CSF
|
||||
expl.Init(CSF, TopAbs_EDGE);
|
||||
for (; expl.More(); expl.Next()) {
|
||||
@ -333,8 +334,10 @@ void NMTAlgo_Splitter::MakeSolids(const TopoDS_Shape& theSolid,
|
||||
}
|
||||
//
|
||||
// DMEF: map edge of CSF - faces of CSF
|
||||
TopTools_IndexedDataMapOfShapeListOfShape DMEF;
|
||||
TopExp::MapShapesAndAncestors(CSF, TopAbs_EDGE, TopAbs_FACE, DMEF);
|
||||
//xf
|
||||
TopExp::MapShapes(CSF, TopAbs_FACE, aMFCSF);
|
||||
//xt
|
||||
//
|
||||
// Fill
|
||||
// 1. MFP - a map of faces to process: map of resulting faces except
|
||||
@ -400,8 +403,9 @@ void NMTAlgo_Splitter::MakeSolids(const TopoDS_Shape& theSolid,
|
||||
TopoDS_Face aFace1 = TopoDS::Face(itl.Value());
|
||||
// remove aFace1 form DMSEFP and MFP
|
||||
LSF.Remove( itl ); // == itl.Next();
|
||||
if (!MFP.Remove(aFace1))
|
||||
if (!MFP.Remove(aFace1)) {
|
||||
continue; // was not is MFP (i.e already checked)
|
||||
}
|
||||
//
|
||||
// check if aFace1 was already added to 2 shells
|
||||
if (!All &&
|
||||
@ -410,6 +414,14 @@ void NMTAlgo_Splitter::MakeSolids(const TopoDS_Shape& theSolid,
|
||||
skipAlreadyAdded = Standard_True;
|
||||
}
|
||||
//
|
||||
//xf
|
||||
if (aMFCSF.Contains(aFace1)) {
|
||||
// the face aFace1 can not be inside CSF
|
||||
// if CSF contains the aFace1
|
||||
continue;
|
||||
}
|
||||
//xt
|
||||
//
|
||||
TopoDS_Shape anOrigFace = aFace1;
|
||||
if (myImagesFaces.IsImage(aFace1)){
|
||||
anOrigFace = myImagesFaces.Root(aFace1);
|
||||
@ -805,7 +817,6 @@ void RefineSolids(const TopoDS_Shape& aSolidOr,
|
||||
aLNS.Clear();
|
||||
aLNS.Append(aSolidOr);
|
||||
}
|
||||
//modified by NIZNHY-PKV Fri Feb 25 16:59:57 2005f XX
|
||||
//=======================================================================
|
||||
//function : GetPlanes
|
||||
//purpose :
|
||||
@ -899,6 +910,7 @@ void GetPlanes (const TopoDS_Edge& anEx,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//modified by NIZNHY-PKV Fri Feb 25 17:00:03 2005t XX
|
||||
/*
|
||||
A
|
||||
|
Loading…
x
Reference in New Issue
Block a user