// Splines //
//-----------------------------------------------------------//
GEOM_Shape MakeBezier (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
- GEOM_Shape MakeBSpline(in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
+ GEOM_Shape MakeInterpol(in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
+
+ //-----------------------------------------------------------//
+ // Sketcher //
+ //-----------------------------------------------------------//
+ GEOM_Shape MakeSketcher (in string Cmd) raises (SALOME::SALOME_Exception) ;
//-----------------------------------------------------------//
// Build //
using namespace std;
#include "BuildGUI.h"
-#include "DisplayGUI.h"
-
-#include "OCCViewer_Viewer3d.h"
-#include "VTKViewer_ViewFrame.h"
-#include "QAD_RightFrame.h"
-#include "GEOM_AssemblyBuilder.h"
-#include "SALOMEGUI_ImportOperation.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
-#include <TopExp_Explorer.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-
-#include "BuildGUI_SubShapeDlg.h" // Method SUBSHAPE
-#include "BuildGUI_SplineDlg.h" // Method SPLINE
#include "BuildGUI_EdgeDlg.h" // Method EDGE
#include "BuildGUI_WireDlg.h" // Method WIRE
#include "BuildGUI_FaceDlg.h" // Method FACE
switch (theCommandID)
{
- case 406: // GEOM::SPLINE
- {
- BuildGUI_SplineDlg *aDlg = new BuildGUI_SplineDlg(parent, "", myBuildGUI, Sel);
- break;
- }
- case 407: // EXPLODE : use ic
- {
- Handle(AIS_InteractiveContext) ic;
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- ic = v3d->getAISContext();
- }
- BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", myBuildGUI, Sel, ic);
- break ;
- }
case 4081: // GEOM::EDGE
{
BuildGUI_EdgeDlg *aDlg = new BuildGUI_EdgeDlg(parent, "", myBuildGUI, Sel);
}
-//=====================================================================================
-// function : MakeBSplineAndDisplay()
-// purpose :
-//=====================================================================================
-void BuildGUI::MakeBSplineAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
-{
- try {
- GEOM::GEOM_Shape_var result = myGeom->MakeBSpline(listShapesIOR);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
- return;
- }
- result->NameType(tr("GEOM_WIRE"));
- if(myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;
-}
-
-
-//=====================================================================================
-// function : MakeBSplineAndDisplay()
-// purpose :
-//=====================================================================================
-void BuildGUI::MakeBezierAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
-{
- try {
- GEOM::GEOM_Shape_var result = myGeom->MakeBezier(listShapesIOR);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
- return;
- }
- result->NameType(tr("GEOM_WIRE"));
- if(myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;
-}
-
-
//=====================================================================================
// function : MakeLinearEdgeAndDisplay()
// purpose :
}
-
-
-//=====================================================================================
-// function : SObjectExist()
-// purpose :
-//=====================================================================================
-bool BuildGUI::SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR)
-{
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theFatherObject);
- SALOMEDS::SObject_var RefSO;
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- for(; it->More();it->Next()) {
- SALOMEDS::SObject_var SO= it->Value();
- if(SO->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- if(strcmp( anIOR->Value(), IOR ) == 0)
- return true;
- }
- if(SO->ReferencedObject(RefSO)) {
- if(RefSO->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- if(strcmp(anIOR->Value(), IOR) == 0)
- return true;
- }
- }
- }
- return false;
-}
-
-
-//=====================================================================================
-// function : OnSubShapeGetAll()
-// purpose : Explode a shape in all sub shapes with a SubShapeType
-//=====================================================================================
-bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType)
-{
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
- if(theObj->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
- return false;
- }
-
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var aName;
- SALOMEDS::AttributeIOR_var anIOR;
- SALOMEDS::AttributePixMap_var aPixmap;
-
- /* We create a sub object for each sub shape as attribute of the main object */
- /* Each sub object contains list (length=1) containing its index in the main shape */
- GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
- GEOM::GEOM_Gen::ListOfGeomShapes_var listGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
- GEOM::GEOM_Shape_var aResult;
-
- try {
- listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
- if(listGeomShapes->length() < 1) {
- QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
- return false;
- }
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- /* open transaction */
- QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
- op->start();
-
- TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
- TopoDS_Shape mainShape;
- bool main = false;
- while(!main) {
- if(aShape->IsMainShape()) {
- mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
- main = true;
- }
- else
- aShape = myGeom->GetIORFromString(aShape->MainName());
- }
-
- /* Loop on each sub shape created */
- /* int i = 1 ; /* index for the nameType */
- for(int j=0; j<listGeomShapes->length(); j++) {
- /* Get each sub shape extracted CORBA and OCC */
- aResult = listGeomShapes[j] ;
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
-
- if (S.IsNull()) {
- QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
- return false;
- }
-
- /* Set the nameType of sub shape */
- char* nameG = (char *)malloc(20);
- Standard_CString Type;
- if(myGeomBase->GetShapeTypeString(S, Type)) {
- aResult->NameType(Type);
- sprintf(nameG, "%s_%d", Type, myGeomBase->GetIndex(S, mainShape, SubShapeType));
- }
- else {
- aResult->NameType(tr("GEOM_SHAPE"));
- sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
- }
- SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
-
- bool allreadyexist = false;
-
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
-
- Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
- Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
-
- MESSAGE ("SO->_is_nil() " << SO->_is_nil())
-
- if(SO->_is_nil()) {
- SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(nameG);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(aResult->Name());
-
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- MESSAGE(" Type " << S.ShapeType())
- if (S.ShapeType() == TopAbs_COMPOUND)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
- else if(S.ShapeType() == TopAbs_COMPSOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
- else if(S.ShapeType() == TopAbs_SOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
- else if(S.ShapeType() == TopAbs_SHELL)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
- else if(S.ShapeType() == TopAbs_FACE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
- else if(S.ShapeType() == TopAbs_WIRE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
- else if(S.ShapeType() == TopAbs_EDGE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
- else if(S.ShapeType() == TopAbs_VERTEX)
- aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
-
- MESSAGE(" aPixmap->GetPixMap " << aPixmap->GetPixMap())
-
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
- aStudyBuilder->Addreference(newObj1, newObj);
- IO->setEntry(newObj->GetID());
-
- aResult->StudyShapeId(newObj->GetID());
- }
- else {
- allreadyexist = true;
- if(!this->SObjectExist(theObj, aResult->Name())) {
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
- aStudyBuilder->Addreference(newObj1, SO);
- IO->setEntry(SO->GetID());
- aResult->StudyShapeId(SO->GetID());
- }
- }
-
- result->setIO(IO);
- result->setName(nameG);
- if(!allreadyexist)
- ic->Display(result);
-
- }
- else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
-
- int themode = myRenderInter->GetDisplayMode();
- vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
- vtkRenderWindow *renWin = theRenderer->GetRenderWindow();
-
- Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
-
- if(SO->_is_nil()) {
- SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(aResult->Name());
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(nameG);
-
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- if(S.ShapeType() == TopAbs_COMPOUND)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
- else if(S.ShapeType() == TopAbs_COMPSOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
- else if(S.ShapeType() == TopAbs_SOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
- else if(S.ShapeType() == TopAbs_SHELL)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
- else if(S.ShapeType() == TopAbs_FACE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
- else if(S.ShapeType() == TopAbs_WIRE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
- else if(S.ShapeType() == TopAbs_EDGE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
- else if(S.ShapeType() == TopAbs_VERTEX)
- aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
-
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
- aStudyBuilder->Addreference(newObj1, newObj);
- IO->setEntry(newObj->GetID());
- }
- else {
- allreadyexist = true;
- if(!this->SObjectExist(theObj, aResult->Name())) {
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
- aStudyBuilder->Addreference(newObj1, SO);
- IO->setEntry(SO->GetID());
- }
- }
-
- if(!allreadyexist) {
- vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(S,0,themode,Standard_True);
- theActors->InitTraversal();
- vtkActor* anActor = (vtkActor*)theActors->GetNextActor();
- while(!(anActor==NULL)) {
- GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
- GActor->setIO(IO);
- GActor->setName(nameG);
- theRenderer->AddActor(GActor);
- renWin->Render();
- anActor = (vtkActor*)theActors->GetNextActor();
- }
- }
- }
- }
-
- /* commit transaction */
- op->finish();
-
- QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
- QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
- return true;
-}
-
-
-//=====================================================================================
-// function : OnSubShapeGetSelected()
-// purpose :
-//=====================================================================================
-bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
-{
- //* Test the type of viewer */
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
- return false;
-
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
- if(theObj->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
- return false;
- }
-
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
-
- if( myUseLocalContext == false ) {
- /* local context is from DialogBox */
- MESSAGE("Error : No local context opened for sub shapes method" << endl ) ;
- return false ;
- }
-
- GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString( ShapeTopoIOR );
- TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
-
- TopoDS_Shape mainShape;
- bool main = false;
- while(!main) {
- if(aShape->IsMainShape()) {
- mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
- main = true;
- }
- else
- aShape = myGeom->GetIORFromString(aShape->MainName());
- }
-
- GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
- ic->InitSelected();
- int nbSelected = ic->NbSelected();
- ListOfID->length(nbSelected);
-
- TopoDS_Compound compound;
- ic->InitSelected(); /* to init again */
- BRep_Builder B;
- B.MakeCompound(compound);
-
- int i = 0;
- /* We create a unique compound containing all the sub shapes selected by user as attribute of the main shape */
- /* the compound is homogenous by selection */
- while(ic->MoreSelected()) {
- int index = myGeomBase->GetIndex(ic->SelectedShape(), mainShape, SubShapeType);
- ListOfID[i] = index;
- B.Add(compound, ic->SelectedShape());
- i++;
- ic->NextSelected();
- }
-
- /* Test if user has selected sub shapes */
- if(ListOfID->length() < 1)
- return false;
-
- GEOM::GEOM_Shape_var aResult;
- try {
- aResult = myGeom->SubShape(aShape, SubShapeType, ListOfID);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- /* local context from DialogBox */
- ic->CloseLocalContext(aLocalContextId);
- myUseLocalContext = false ;
-
- char* nameG = (char *)malloc(20);
- Standard_CString Type;
-
- Handle(GEOM_AISShape) result;
- Handle(GEOM_InteractiveObject) IO;
-
- if(nbSelected == 1) {
- TopExp_Explorer Exp (compound, TopAbs_ShapeEnum(SubShapeType));
- if(Exp.More()) {
- if(myGeomBase->GetShapeTypeString(Exp.Current(),Type)) {
- aResult->NameType(Type);
- sprintf (nameG, "%s_%d", Type, myGeomBase->GetIndex( Exp.Current(), mainTopo, SubShapeType));
- }
- else {
- aResult->NameType(tr("GEOM_SHAPE"));
- sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
- }
- result = new GEOM_AISShape(Exp.Current(), nameG);
- IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
- }
- }
- else {
- if ( myGeomBase->GetShapeTypeString(compound,Type)) {
- aResult->NameType(Type);
- sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
- } else {
- aResult->NameType(tr("GEOM_SHAPE"));
- sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
- }
- result = new GEOM_AISShape(compound, nameG);
- IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
- }
-
- SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
-
- /* open transaction */
- QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
- op->start();
-
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var aName;
- SALOMEDS::AttributeIOR_var anIOR;
- SALOMEDS::AttributePixMap_var aPixmap;
-
- bool allreadyexist = false;
-
- if(SO->_is_nil()) {
- SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(aResult->Name());
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(result->getName());
-
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- if(result->Shape().ShapeType() == TopAbs_COMPOUND)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
- else if(result->Shape().ShapeType() == TopAbs_COMPSOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
- else if(result->Shape().ShapeType() == TopAbs_SOLID)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
- else if(result->Shape().ShapeType() == TopAbs_SHELL)
- aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
- else if(result->Shape().ShapeType() == TopAbs_FACE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
- else if(result->Shape().ShapeType() == TopAbs_WIRE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
- else if(result->Shape().ShapeType() == TopAbs_EDGE)
- aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
- else if(result->Shape().ShapeType() == TopAbs_VERTEX)
- aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
-
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
- aStudyBuilder->Addreference(newObj1, newObj);
-
- IO->setEntry(newObj->GetID());
- aResult->StudyShapeId(newObj->GetID());
- }
- else {
- allreadyexist = true;
- if(!this->SObjectExist(theObj, aResult->Name())) {
- SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
- aStudyBuilder->Addreference(newObj1, SO);
-
- IO->setEntry(SO->GetID());
- aResult->StudyShapeId(SO->GetID());
- }
- }
-
- /* commit transaction */
- op->finish();
-
- result->setIO(IO);
- result->setName(nameG);
-
- if(!allreadyexist)
- ic->Display(result);
-
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
-
- QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
- QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
- return true;
-}
-
-
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
void MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
void MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
- void MakeBSplineAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
- void MakeBezierAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
-
- /* Methods for sub shapes explode */
- bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
- bool OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType);
- bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
- Standard_Integer& aLocalContextId, bool& myUseLocalContext);
-
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : BuildGUI_SplineDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "BuildGUI_SplineDlg.h"
-
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <GeomAPI_PointsToBSpline.hxx>
-#include <BRep_Tool.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
-
-//=================================================================================
-// class : BuildGUI_SplineDlg()
-// purpose : Constructs a BuildGUI_SplineDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'.
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//=================================================================================
-BuildGUI_SplineDlg::BuildGUI_SplineDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BEZIER")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BSPLINE")));
- QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
-
- setCaption(tr("GEOM_SPLINE_TITLE"));
-
- /***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_SPLINE"));
- RadioButton1->setPixmap(image0);
- RadioButton2->setPixmap(image1);
- RadioButton3->close(TRUE);
-
- GroupBezier = new DlgRef_1Sel_QTD(this, "GroupBezier");
- GroupBezier->GroupBox1->setTitle(tr("GEOM_BEZIER"));
- GroupBezier->TextLabel1->setText(tr("GEOM_POINTS"));
- GroupBezier->PushButton1->setPixmap(image2);
-
- GroupBSpline = new DlgRef_1Sel_QTD(this, "GroupBSpline");
- GroupBSpline->GroupBox1->setTitle(tr("GEOM_BSPLINE"));
- GroupBSpline->TextLabel1->setText(tr("GEOM_POINTS"));
- GroupBSpline->PushButton1->setPixmap(image2);
-
- Layout1->addWidget(GroupBezier, 1, 0);
- Layout1->addWidget(GroupBSpline, 1, 0);
- /***************************************************************/
-
- /* Initialisations */
- myBuildGUI = theBuildGUI;
- Init();
-}
-
-
-//=================================================================================
-// function : ~BuildGUI_SplineDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-BuildGUI_SplineDlg::~BuildGUI_SplineDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::Init()
-{
- /* init variables */
- myConstructorId = 0;
- myEditCurrentArgument = GroupBezier->LineEdit1;
- myOkListShapes = false;
-
- /* Vertices Filter for all arguments */
- myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
- mySelection->AddFilter(myVertexFilter);
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
-
- connect(GroupBezier->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupBSpline->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- /* displays Dialog */
- GroupBSpline->hide();
- GroupBezier->show();
- this->show();
-
- return;
-}
-
-
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void BuildGUI_SplineDlg::ConstructorsClicked(int constructorId)
-{
- myConstructorId = constructorId;
- mySelection->ClearFilters();
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
- disconnect(mySelection, 0, this, 0);
- myOkListShapes = false;
-
- switch (constructorId)
- {
- case 0:
- {
- GroupBSpline->hide();
- resize(0, 0);
- GroupBezier->show();
-
- myEditCurrentArgument = GroupBezier->LineEdit1;
- GroupBezier->LineEdit1->setText("");
- break;
- }
- case 1:
- {
- GroupBezier->hide();
- resize(0, 0);
- GroupBSpline->show();
-
- myEditCurrentArgument = GroupBSpline->LineEdit1;
- GroupBSpline->LineEdit1->setText("");
- break;
- }
- }
- /* filter for next selection */
- mySelection->AddFilter(myVertexFilter);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::ClickOnOk()
-{
- this->ClickOnApply();
- ClickOnCancel();
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::ClickOnApply()
-{
- QAD_Application::getDesktop()->putInfo(tr(""));
- if (mySimulationTopoDs.IsNull())
- return;
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
-
- switch(myConstructorId)
- {
- case 0 :
- {
- if(myOkListShapes)
- myBuildGUI->MakeBezierAndDisplay(myListShapes);
- break;
- }
- case 1 :
- {
- if(myOkListShapes)
- myBuildGUI->MakeBSplineAndDisplay(myListShapes);
- break;
- }
- }
- return;
-}
-
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-//=================================================================================
-void BuildGUI_SplineDlg::SelectionIntoArgument()
-{
- myGeomBase->EraseSimulationShape();
- myEditCurrentArgument->setText("");
- QString aString = ""; /* name of selection */
-
- int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
- if(nbSel < 2) {
- myOkListShapes = false;
- return;
- }
-
- myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
- myEditCurrentArgument->setText(aString);
- myOkListShapes = true;
-
- this->MakeSplineSimulationAndDisplay();
- return;
-}
-
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
-
- if(send == GroupBezier->PushButton1) {
- GroupBezier->LineEdit1->setFocus();
- myEditCurrentArgument = GroupBezier->LineEdit1;
- }
- else if(send == GroupBSpline->PushButton1) {
- GroupBSpline->LineEdit1->setFocus();
- myEditCurrentArgument = GroupBSpline->LineEdit1;
- }
- mySelection->AddFilter(myVertexFilter);
- this->SelectionIntoArgument();
-
- return;
-}
-
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- mySelection->AddFilter(myVertexFilter);
- if(!mySimulationTopoDs.IsNull())
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
- return;
-}
-
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::enterEvent(QEvent* e)
-{
- if (GroupConstructors->isEnabled())
- return;
- this->ActivateThisDialog();
- return;
-}
-
-
-//=================================================================================
-// function : MakeSplineSimulationAndDisplay()
-// purpose :
-//=================================================================================
-void BuildGUI_SplineDlg::MakeSplineSimulationAndDisplay()
-{
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
-
- if(!myOkListShapes)
- return;
-
- try {
- TColgp_Array1OfPnt CurvePoints(1, myListShapes.length());
- SALOME_ListIteratorOfListIO It(mySelection->StoredIObjects());
- int i = 1;
- for(;It.More(); It.Next()) {
- Standard_Boolean found;
- Handle(GEOM_AISShape) AISShape = myGeomBase->ConvertIOinGEOMAISShape(It.Value(), found);
- if(!found)
- return;
- TopoDS_Shape Shape = AISShape->Shape();
- if(Shape.IsNull())
- return;
- if(Shape.ShapeType() == TopAbs_VERTEX) {
- const gp_Pnt& P = BRep_Tool::Pnt(TopoDS::Vertex(Shape));
- CurvePoints.SetValue(i, P);
- }
- i++;
- }
- switch(myConstructorId)
- {
- case 0 :
- {
- Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
- mySimulationTopoDs = BRepBuilderAPI_MakeEdge(GBC);
- break;
- }
- case 1 :
- {
- GeomAPI_PointsToBSpline GBC(CurvePoints);
- mySimulationTopoDs = BRepBuilderAPI_MakeEdge(GBC);
- break;
- }
- }
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
- }
- catch(Standard_Failure) {
- MESSAGE("Exception catched in MakeSplineSimulationAndDisplay");
- return;
- }
- return;
-}
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : BuildGUI_SplineDlg.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef DIALOGBOX_SPLINE_H
-#define DIALOGBOX_SPLINE_H
-
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_1Sel_QTD.h"
-
-#include "BuildGUI.h"
-
-#include "GEOM_ShapeTypeFilter.hxx"
-
-//=================================================================================
-// class : BuildGUI_WireDlg
-// purpose :
-//=================================================================================
-class BuildGUI_SplineDlg : public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- BuildGUI_SplineDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
- ~BuildGUI_SplineDlg();
-
-private:
- void Init();
- void enterEvent(QEvent* e);
- void MakeSplineSimulationAndDisplay();
-
- BuildGUI* myBuildGUI;
-
- int myConstructorId;
- Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */
-
- GEOM::GEOM_Gen::ListOfIOR myListShapes;
- bool myOkListShapes; /* to check when arguments is defined */
-
- DlgRef_1Sel_QTD* GroupBezier;
- DlgRef_1Sel_QTD* GroupBSpline;
-
-private slots:
- void ClickOnOk();
- void ClickOnApply();
- void ActivateThisDialog();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int constructorId);
-
-};
-
-#endif // DIALOGBOX_SPLINE_H
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : BuildGUI_SubShapeDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "BuildGUI_SubShapeDlg.h"
-
-#include "DisplayGUI.h"
-#include "QAD_RightFrame.h"
-#include "OCCViewer_Viewer3d.h"
-
-#include <TopExp_Explorer.hxx>
-#include <TopTools_MapOfShape.hxx>
-
-#include <qmessagebox.h>
-
-//=================================================================================
-// class : BuildGUI_SubShapeDlg()
-// purpose : Constructs a BuildGUI_SubShapeDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'.
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//=================================================================================
-BuildGUI_SubShapeDlg::BuildGUI_SubShapeDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SUBSHAPE")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
-
- setCaption(tr("GEOM_SUBSHAPE_TITLE"));
-
- /***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_SUB_SHAPE"));
- RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
- RadioButton3->close(TRUE);
-
- GroupPoints = new DlgRef_1Sel1Check1List_QTD(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_SUBSHAPE_TYPE"));
- GroupPoints->CheckButton1->setText(tr("GEOM_SUBSHAPE_SELECT"));
- GroupPoints->PushButton1->setPixmap(image1);
-
- Layout1->addWidget(GroupPoints, 1, 0);
- /***************************************************************/
-
- /* Initialisations */
- myBuildGUI = theBuildGUI;
- Init(ic);
-}
-
-
-//=================================================================================
-// function : ~BuildGUI_SubShapeDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-BuildGUI_SubShapeDlg::~BuildGUI_SubShapeDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::Init(Handle(AIS_InteractiveContext) ic)
-{
- /* init variables */
- myEditCurrentArgument = GroupPoints->LineEdit1;
-
- myWithShape = true;
- myAbort = myOkShape = myUseLocalContext = false;
- myIC = ic;
- myLocalContextId = -1;
-
- /* type for sub shape selection */
- GroupPoints->ComboBox1->insertItem("Compound");
- GroupPoints->ComboBox1->insertItem("Compsolid");
- GroupPoints->ComboBox1->insertItem("Solid");
- GroupPoints->ComboBox1->insertItem("Shell");
- GroupPoints->ComboBox1->insertItem("Face");
- GroupPoints->ComboBox1->insertItem("Wire");
- GroupPoints->ComboBox1->insertItem("Edge");
- GroupPoints->ComboBox1->insertItem("Vertex");
- GroupPoints->ComboBox1->insertItem("Shape");
-
- myShapeType = GroupPoints->ComboBox1->currentItem();
- myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
-
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
- GroupPoints->CheckButton1->setEnabled(false);
-
- /* signals and slots connections */
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
- connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
- connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(AllOrNotAll()));
-
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- /* displays Dialog */
- GroupPoints->show();
- this->show();
-
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::ClickOnOk()
-{
- this->ClickOnApply();
-
- /* User has aborted or not operation of explode all with many sub shapes */
- if(myAbort == false)
- this->ClickOnCancel();
- else
- myAbort = false;
-
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::ClickOnApply()
-{
- QAD_Application::getDesktop()->putInfo(tr(""));
- bool testResult = false;
- myAbort = false; /* Not aborted by default */
-
- /* Explode all sub shapes */
- if(myOkShape && !myOkSelectSubMode) {
- /* More than 30 subshapes : ask confirmation */
- unsigned int nb = NumberOfSubShapes(myShape, myShapeType);
- if(nb > 30) {
- const QString caption = tr("GEOM_CONFIRM");
- const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
- const QString button0 = tr("GEOM_BUT_EXPLODE");
- const QString button1 = tr("GEOM_BUT_CANCEL");
-
- if(QMessageBox::warning(this, caption, text, button0, button1) == 0)
- testResult = myBuildGUI->OnSubShapeGetAll(myShape, myShapeIOR, myShapeType);
- else
- myAbort = true; /* aborted */
- }
- else
- testResult = myBuildGUI->OnSubShapeGetAll(myShape, myShapeIOR, myShapeType);
- }
- /* explode only selected sub shapes */
- else if(myOkShape && myOkSelectSubMode)
- testResult = myBuildGUI->OnSubShapeGetSelected(myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext);
-
- if(!testResult) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- myAbort = true;
- }
- else
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
-
- /* Reset all arguments and local context to allow user a new selection ...*/
- this->ResetStateOfDialog();
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::ClickOnCancel()
-{
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- myUseLocalContext = false;
- }
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- }
- GEOMBase_Skeleton::ClickOnCancel();
- return;
-}
-
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-// : used only by SelectButtonC1A1 (LineEditC1A1)
-//=================================================================================
-void BuildGUI_SubShapeDlg::SelectionIntoArgument()
-{
- myEditCurrentArgument->setText("");
- this->ResetStateOfDialog();
- QString aString = ""; /* name of selection */
-
- int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
- if(nbSel != 1) {
- myOkShape = false;
- return;
- }
-
- /* nbSel == 1 */
- TopoDS_Shape S;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
- if(!myGeomBase->GetTopoFromSelection(mySelection, S))
- return;
-
- if(!IO->hasEntry()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
- return;
- }
-
- if(!S.IsNull() && S.ShapeType() != TopAbs_VERTEX) {
- if(IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
- Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO );
- myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
- myEditCurrentArgument->setText(aString);
- myShape = S;
- myOkShape = true;
- }
- else {
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- if(!obj->_is_nil()) {
- if(obj->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- myShapeIOR = anIOR->Value();
- myOkShape = true;
- myShape = S;
- GroupPoints->LineEdit1->setText(aString);
- }
- }
- }
-
- int SelectedShapeType = GroupPoints->ComboBox1->currentItem();
- int count = GroupPoints->ComboBox1->count();
-
- if(myWithShape)
- count = count - 1;
-
- int i = 0;
- while(i <= myShape.ShapeType()) {
- GroupPoints->ComboBox1->removeItem(0);
- i++;
- }
-
- if(myShape.ShapeType()==TopAbs_COMPOUND) {
- if(myWithShape == false) {
- GroupPoints->ComboBox1->insertItem("Shape");
- myWithShape = true;
- }
- }
- else {
- if(myWithShape == true) {
- GroupPoints->ComboBox1->removeItem(GroupPoints->ComboBox1->count() - 1);
- myWithShape = false;
- }
- }
-
- int count1 = GroupPoints->ComboBox1->count();
- if(myWithShape)
- count1 = count1 - 1;
-
- if(SelectedShapeType > myShape.ShapeType()) {
- if(SelectedShapeType == 8) {
- if(myShape.ShapeType() != TopAbs_COMPOUND) {
- GroupPoints->ComboBox1->setCurrentItem(0);
- myShapeType = 8 - count1;
- }
- }
- else {
- GroupPoints->ComboBox1->setCurrentItem(count1 - count + SelectedShapeType);
- myShapeType = 8 - count1 + GroupPoints->ComboBox1->currentItem();
- }
- }
- else {
- GroupPoints->ComboBox1->setCurrentItem(0);
- myShapeType = 8 - count1;
- }
- }
- return;
-}
-
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
-
- if(send == GroupPoints->PushButton1) {
- GroupPoints->LineEdit1->setFocus();
- myEditCurrentArgument = GroupPoints->LineEdit1;
- }
- this->SelectionIntoArgument();
-
- return;
-}
-
-
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1)
- myEditCurrentArgument = GroupPoints->LineEdit1;
- else
- return;
-
- GEOMBase_Skeleton::LineEditReturnPressed();
- return;
-}
-
-
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::DeactivateActiveDialog()
-{
- if(GroupConstructors->isEnabled()) {
- this->ResetStateOfDialog();
- GEOMBase_Skeleton::DeactivateActiveDialog();
- }
- return;
-}
-
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
- GroupPoints->CheckButton1->setEnabled(true);
- else
- GroupPoints->CheckButton1->setEnabled(false);
- return;
-}
-
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::enterEvent(QEvent* e)
-{
- if(GroupConstructors->isEnabled())
- return;
- this->ActivateThisDialog();
- return;
-}
-
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::closeEvent(QCloseEvent* e)
-{
- /* same than click on cancel button */
- this->ClickOnCancel();
- return;
-}
-
-
-//=================================================================================
-// function : ResetStateOfDialog()
-// purpose : Completely reset the state of method including local context
-//=================================================================================
-void BuildGUI_SubShapeDlg::ResetStateOfDialog()
-{
- if(myAbort == true) {
- myOkShape = false;
- myEditCurrentArgument->setText("");
- }
-
- int SelectedShapeType = GroupPoints->ComboBox1->currentItem();
- int count = GroupPoints->ComboBox1->count();
- if(myWithShape)
- count = count - 1;
-
- /* type for sub shape selection */
- GroupPoints->ComboBox1->clear();
- GroupPoints->ComboBox1->insertItem("Compound");
- GroupPoints->ComboBox1->insertItem("Compsolid");
- GroupPoints->ComboBox1->insertItem("Solid");
- GroupPoints->ComboBox1->insertItem("Shell");
- GroupPoints->ComboBox1->insertItem("Face");
- GroupPoints->ComboBox1->insertItem("Wire");
- GroupPoints->ComboBox1->insertItem("Edge");
- GroupPoints->ComboBox1->insertItem("Vertex");
- GroupPoints->ComboBox1->insertItem("Shape");
- myWithShape=true;
- GroupPoints->ComboBox1->setCurrentItem(8 - count + SelectedShapeType);
- myOkSelectSubMode = false;
-
- /* unpress buttons : due to abort box*/
- buttonApply->setDown(FALSE);
- buttonOk->setDown(FALSE);
- GroupPoints->CheckButton1->setChecked(FALSE);
-
- /* Close its local contact if opened */
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- myUseLocalContext = false;
- }
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- }
- return;
-}
-
-
-//=================================================================================
-// function : AllOrNotAll()
-// purpose : Allow user selection of all or only selected sub shapes
-// : Called when 'CheckButton1' state change
-//=================================================================================
-void BuildGUI_SubShapeDlg::AllOrNotAll()
-{
- /* No sub shape selection if main shape not selected */
- if(!myOkShape) {
- this->ResetStateOfDialog();
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
- return;
- }
-
- if(myShapeType ==TopAbs_SHAPE && myShape.ShapeType()==TopAbs_COMPOUND) {
- /* Select sub shapes mode not checked */
- myOkSelectSubMode = false;
- GroupPoints->CheckButton1->setChecked( FALSE );
- //no meaning to allow user selection for type = shape
- //TODO - add another message
- //QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
- return;
- }
-
- myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
-
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
-
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- myUseLocalContext = false;
- }
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- }
- else {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
- return;
- }
-
- if(myOkShape && myOkSelectSubMode) {
- /* local context is defined into the method */
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);
- myUseLocalContext = true;
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
- }
- return;
-}
-
-
-//=================================================================================
-// function : ComboTextChanged()
-// purpose :
-//=================================================================================
-void BuildGUI_SubShapeDlg::ComboTextChanged()
-{
- if(myOkShape)
- myShapeType = GroupPoints->ComboBox1->currentItem() + myShape.ShapeType() + 1;
- else
- myShapeType = GroupPoints->ComboBox1->currentItem();
-
- /* Select sub shapes mode not checked */
- GroupPoints->CheckButton1->setChecked(FALSE);
- myOkSelectSubMode = FALSE;
-
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
-
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- myUseLocalContext = false;
- }
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- }
- return;
-}
-
-
-//=================================================================================
-// function : NumberOfSubShapes()
-// purpose :
-//=================================================================================
-unsigned int BuildGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType)
-{
- if(S.IsNull())
- return 0;
-
- unsigned int index = 0;
- TopExp_Explorer Exp(S, TopAbs_ShapeEnum(shapeType));
- TopTools_MapOfShape M;
- while(Exp.More()) {
- if(M.Add(Exp.Current()))
- index++;
- Exp.Next();
- }
- M.Clear();
- return index;
-}
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : BuildGUI_SubShapeDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
-
-#ifndef DIALOGBOX_SUBSHAPE_H
-#define DIALOGBOX_SUBSHAPE_H
-
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_1Sel1Check1List_QTD.h"
-
-#include "BuildGUI.h"
-
-//=================================================================================
-// class : BuildGUI_SubShapeDlg
-// purpose :
-//=================================================================================
-class BuildGUI_SubShapeDlg : public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- BuildGUI_SubShapeDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, Handle(AIS_InteractiveContext) ic = 0, bool modal = FALSE, WFlags fl = 0);
- ~BuildGUI_SubShapeDlg();
-
-private :
- void Init(Handle(AIS_InteractiveContext) ic);
- void enterEvent(QEvent* e);
- void closeEvent(QCloseEvent* e);
-
- void ResetStateOfDialog();
- unsigned int NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType);
-
- BuildGUI* myBuildGUI;
-
- /* Interactive and local context management see also : bool myUseLocalContext() */
- Handle(AIS_InteractiveContext) myIC; /* Interactive context */
- Standard_Integer myLocalContextId; /* identify a local context used by this method */
- bool myUseLocalContext; /* true when this method as opened a local context */
-
- TopoDS_Shape myShape;
- bool myOkShape;
- char* myShapeIOR;
- int myShapeType;
-
- bool myWithShape; /* check if Shape item exists */
- bool myOkSelectSubMode; /* true = sub mode selection activated */
- bool myAbort; /* Indicate if sub Shape All has been aborted by user */
-
- DlgRef_1Sel1Check1List_QTD* GroupPoints;
-
-private slots:
- void ClickOnOk();
- void ClickOnApply();
- void ClickOnCancel();
- void ActivateThisDialog();
- void DeactivateActiveDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void AllOrNotAll();
- void ComboTextChanged();
-
-};
-
-#endif // DIALOGBOX_SUBSHAPE_H
LIB = libBuildGUI.la
LIB_SRC = BuildGUI.cxx \
- BuildGUI_SubShapeDlg.cxx \
- BuildGUI_SplineDlg.cxx \
BuildGUI_EdgeDlg.cxx \
BuildGUI_WireDlg.cxx \
BuildGUI_FaceDlg.cxx \
LIB_MOC = \
BuildGUI.h \
- BuildGUI_SubShapeDlg.h \
- BuildGUI_SplineDlg.h \
BuildGUI_EdgeDlg.h \
BuildGUI_WireDlg.h \
BuildGUI_FaceDlg.h \
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI
+LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
@CONCLUDE@
}
case 212: // MENU VIEW - DISPLAY ALL
{
-// if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
-// ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
-// else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
myDisplayGUI->OnDisplayAll();
break;
}
if(mode == -1)
mode = (AIS_DisplayMode)ic->DisplayMode();
- QApplication::setOverrideCursor(Qt::waitCursor);
ic->SetDisplayMode(Shape, mode == AIS_WireFrame ? AIS_Shaded : AIS_WireFrame, false);
}
- QApplication::restoreOverrideCursor();
}
ic->UpdateCurrentViewer();
}
}
}
}
-// AIS_ListOfInteractive List1;
-// myContext->ObjectsInCollector(List1);
-// AIS_ListIteratorOfListOfInteractive ite1(List1);
-// while(ite1.More()) {
-// cout<<"DCQ 1"<<endl;
-// if(ite1.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
-// Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite1.Value());
-// if(aSh->hasIO()) {
-// Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
-// if(v3d->isInViewer(GIO, true)) {
-// myContext->Display(aSh);
-// }
-// }
-// }
-// ite1.Next();
-// }
}
else {
AIS_ListOfInteractive aListDisplayedObject;
GEOM_Actor* aSh = myGeomBase->ConvertIORinGEOMActor(anIOR->Value(), testResult);
if(testResult) {
Handle(SALOME_InteractiveObject) IObject = aSh->getIO();
- // if(myRenderInter->isInViewer(IObject)) {
((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->Display(IObject);
- //}
}
else {
GEOM::GEOM_Shape_ptr aShape = myGeom->GetIORFromString(anIOR->Value());
}
}
}
-// ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
}
return;
}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "EntityGUI.h"
+
+#include "QAD_RightFrame.h"
+#include "OCCViewer_Viewer3d.h"
+#include "VTKViewer_ViewFrame.h"
+#include "GEOM_AssemblyBuilder.h"
+#include "SALOMEGUI_ImportOperation.h"
+#include "SALOMEGUI_QtCatchCorbaException.hxx"
+
+#include <BRepTools_WireExplorer.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Compound.hxx>
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <gp_Circ.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Curve.hxx>
+
+#include "DisplayGUI.h"
+
+#include "EntityGUI_SketcherDlg.h" // Sketcher
+#include "EntityGUI_SplineDlg.h" // Method SPLINE
+#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+
+//=======================================================================
+// function : EntityGUI()
+// purpose : Constructor
+//=======================================================================
+EntityGUI::EntityGUI() :
+ QObject()
+{
+ myGeomBase = new GEOMBase();
+ myGeomGUI = GEOMContext::GetGeomGUI();
+ myGeom = myGeomGUI->myComponentGeom;
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
+}
+
+
+//=======================================================================
+// function : ~EntityGUI()
+// purpose : Destructor
+//=======================================================================
+EntityGUI::~EntityGUI()
+{
+}
+
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool EntityGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
+{
+ EntityGUI* myEntityGUI = new EntityGUI();
+ myEntityGUI->myGeomGUI->EmitSignalDeactivateDialog();
+ SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
+
+ switch (theCommandID)
+ {
+ case 404: // SKETCHER
+ {
+ ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002
+ EntityGUI_SketcherDlg* aDlg = new EntityGUI_SketcherDlg(parent, "", myEntityGUI, Sel);
+ break;
+ }
+ case 406: // GEOM::SPLINE
+ {
+ EntityGUI_SplineDlg *aDlg = new EntityGUI_SplineDlg(parent, "", myEntityGUI, Sel);
+ break;
+ }
+ case 407: // EXPLODE : use ic
+ {
+ Handle(AIS_InteractiveContext) ic;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ ic = v3d->getAISContext();
+ }
+ EntityGUI_SubShapeDlg *aDlg = new EntityGUI_SubShapeDlg(parent, "", myEntityGUI, Sel, ic);
+ break ;
+ }
+ default:
+ {
+ parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ break;
+ }
+ }
+ return true;
+}
+
+
+//=======================================================================
+// function : OnSketchEnd()
+// purpose :
+//=======================================================================
+void EntityGUI::OnSketchEnd(TopoDS_Shape myShape)
+{
+ TopoDS_Wire W = TopoDS::Wire(myShape);
+
+ if(!W.IsNull()) {
+ GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
+ listShapes->length(0);
+ unsigned int i = 0;
+
+ BRepTools_WireExplorer Ex(W);
+ while(Ex.More()) {
+ TopoDS_Edge E = TopoDS::Edge(Ex.Current());
+
+ gp_Pnt pt1, pt2;
+ pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
+ pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
+
+ gp_Pnt CenterPoint;
+ Handle(Geom_Curve) Curve;
+ Handle(Geom_Circle) Circle;
+ gp_Circ Circ;
+ Standard_Real First,Last;
+
+ Curve = BRep_Tool::Curve(E,First,Last);
+ if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
+ Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
+ Circ = Circle->Circ(); // gp_Circ
+
+ Curve->D0((First + Last) / 2., CenterPoint);
+
+ GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
+ GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
+ GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
+
+ GEOM::GEOM_Shape_var arc;
+
+ try {
+ arc = myGeom->MakeArc(pI, pC, pE);
+ }
+ catch (const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+
+ listShapes->length(i+1);
+ listShapes[i] = strdup(arc->Name());
+ i++;
+ } else {
+ GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
+ GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
+ GEOM::GEOM_Shape_var segment;
+
+ try {
+ segment = myGeom->MakeEdge(pI,pE);
+ }
+ catch (const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+
+ listShapes->length(i+1);
+ listShapes[i] = strdup(segment->Name());
+ i++;
+ }
+ Ex.Next();
+ }
+
+ GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
+ TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
+ Standard_CString type;
+ myGeomBase->GetShapeTypeString(S,type);
+ Wire->NameType(type);
+
+ if(myGeomBase->Display(Wire))
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ }
+ return;
+}
+
+
+//=====================================================================================
+// function : DisplaySimulationShape()
+// purpose : Displays 'this->mySimulationShape' a pure graphical shape from a TopoDS_Shape
+//=====================================================================================
+void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
+{
+ //NRI DEBUG : 14/02/2002
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ return;
+
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ try {
+ if(!S1.IsNull()) {
+ /* erase any previous */
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape1->Set(S1);
+ mySimulationShape1->SetColor(Quantity_NOC_RED);
+
+ ic->Deactivate(mySimulationShape1);
+ ic->Display(mySimulationShape1, Standard_False);
+ mySimulationShape1->UnsetColor();
+ }
+ if(!S2.IsNull()) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2->Set(S2);
+ mySimulationShape2->SetColor(Quantity_NOC_VIOLET);
+
+ ic->Deactivate(mySimulationShape2);
+ ic->Display(mySimulationShape2, Standard_False);
+ mySimulationShape2->UnsetColor();
+ }
+ ic->UpdateCurrentViewer();
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in EntityGUI::DisplaySimulationShape ");
+ }
+ return;
+}
+
+
+//==================================================================================
+// function : EraseSimulationShape()
+// purpose : Clears the display of 'mySimulationShape' a pure graphical shape
+//==================================================================================
+void EntityGUI::EraseSimulationShape()
+{
+ int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
+ for(int i = 0; i < count; i++) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+ ic->UpdateCurrentViewer();
+ }
+ }
+}
+
+
+//=====================================================================================
+// function : MakeBSplineAndDisplay()
+// purpose :
+//=====================================================================================
+void EntityGUI::MakeBezierAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
+{
+ try {
+ GEOM::GEOM_Shape_var result = myGeom->MakeBezier(listShapesIOR);
+ if(result->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ return;
+ }
+ result->NameType(tr("GEOM_WIRE"));
+ if(myGeomBase->Display(result))
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ }
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+ return;
+}
+
+
+//=====================================================================================
+// function : MakeInterpolAndDisplay()
+// purpose :
+//=====================================================================================
+void EntityGUI::MakeInterpolAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
+{
+ try {
+ GEOM::GEOM_Shape_var result = myGeom->MakeInterpol(listShapesIOR);
+ if(result->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ return;
+ }
+ result->NameType(tr("GEOM_WIRE"));
+ if(myGeomBase->Display(result))
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ }
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+ return;
+}
+
+
+//=====================================================================================
+// function : SObjectExist()
+// purpose :
+//=====================================================================================
+bool EntityGUI::SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR)
+{
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theFatherObject);
+ SALOMEDS::SObject_var RefSO;
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeIOR_var anIOR;
+ for(; it->More();it->Next()) {
+ SALOMEDS::SObject_var SO= it->Value();
+ if(SO->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ if(strcmp( anIOR->Value(), IOR ) == 0)
+ return true;
+ }
+ if(SO->ReferencedObject(RefSO)) {
+ if(RefSO->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ if(strcmp(anIOR->Value(), IOR) == 0)
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
+//=====================================================================================
+// function : OnSubShapeGetAll()
+// purpose : Explode a shape in all sub shapes with a SubShapeType
+//=====================================================================================
+bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType)
+{
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
+ if(theObj->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ return false;
+ }
+
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeName_var aName;
+ SALOMEDS::AttributeIOR_var anIOR;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ /* We create a sub object for each sub shape as attribute of the main object */
+ /* Each sub object contains list (length=1) containing its index in the main shape */
+ GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
+ GEOM::GEOM_Gen::ListOfGeomShapes_var listGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
+ GEOM::GEOM_Shape_var aResult;
+
+ try {
+ listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
+ if(listGeomShapes->length() < 1) {
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
+ return false;
+ }
+ }
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+
+ /* open transaction */
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
+ op->start();
+
+ TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
+ TopoDS_Shape mainShape;
+ bool main = false;
+ while(!main) {
+ if(aShape->IsMainShape()) {
+ mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
+ main = true;
+ }
+ else
+ aShape = myGeom->GetIORFromString(aShape->MainName());
+ }
+
+ /* Loop on each sub shape created */
+ /* int i = 1 ; /* index for the nameType */
+ for(int j=0; j<listGeomShapes->length(); j++) {
+ /* Get each sub shape extracted CORBA and OCC */
+ aResult = listGeomShapes[j] ;
+ TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
+
+ if (S.IsNull()) {
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
+ return false;
+ }
+
+ /* Set the nameType of sub shape */
+ char* nameG = (char *)malloc(20);
+ Standard_CString Type;
+ if(myGeomBase->GetShapeTypeString(S, Type)) {
+ aResult->NameType(Type);
+ sprintf(nameG, "%s_%d", Type, myGeomBase->GetIndex(S, mainShape, SubShapeType));
+ }
+ else {
+ aResult->NameType(tr("GEOM_SHAPE"));
+ sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ }
+ SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
+
+ bool allreadyexist = false;
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
+
+ Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
+ Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
+
+ MESSAGE ("SO->_is_nil() " << SO->_is_nil())
+
+ if(SO->_is_nil()) {
+ SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(nameG);
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(aResult->Name());
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ MESSAGE(" Type " << S.ShapeType())
+ if (S.ShapeType() == TopAbs_COMPOUND)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
+ else if(S.ShapeType() == TopAbs_COMPSOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
+ else if(S.ShapeType() == TopAbs_SOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
+ else if(S.ShapeType() == TopAbs_SHELL)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
+ else if(S.ShapeType() == TopAbs_FACE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
+ else if(S.ShapeType() == TopAbs_WIRE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
+ else if(S.ShapeType() == TopAbs_EDGE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
+ else if(S.ShapeType() == TopAbs_VERTEX)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
+
+ MESSAGE(" aPixmap->GetPixMap " << aPixmap->GetPixMap())
+
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
+ aStudyBuilder->Addreference(newObj1, newObj);
+ IO->setEntry(newObj->GetID());
+
+ aResult->StudyShapeId(newObj->GetID());
+ }
+ else {
+ allreadyexist = true;
+ if(!this->SObjectExist(theObj, aResult->Name())) {
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
+ aStudyBuilder->Addreference(newObj1, SO);
+ IO->setEntry(SO->GetID());
+ aResult->StudyShapeId(SO->GetID());
+ }
+ }
+
+ result->setIO(IO);
+ result->setName(nameG);
+ if(!allreadyexist)
+ ic->Display(result);
+
+ }
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
+
+ int themode = myRenderInter->GetDisplayMode();
+ vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
+ vtkRenderWindow *renWin = theRenderer->GetRenderWindow();
+
+ Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
+
+ if(SO->_is_nil()) {
+ SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(aResult->Name());
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(nameG);
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ if(S.ShapeType() == TopAbs_COMPOUND)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
+ else if(S.ShapeType() == TopAbs_COMPSOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
+ else if(S.ShapeType() == TopAbs_SOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
+ else if(S.ShapeType() == TopAbs_SHELL)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
+ else if(S.ShapeType() == TopAbs_FACE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
+ else if(S.ShapeType() == TopAbs_WIRE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
+ else if(S.ShapeType() == TopAbs_EDGE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
+ else if(S.ShapeType() == TopAbs_VERTEX)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
+
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
+ aStudyBuilder->Addreference(newObj1, newObj);
+ IO->setEntry(newObj->GetID());
+ }
+ else {
+ allreadyexist = true;
+ if(!this->SObjectExist(theObj, aResult->Name())) {
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
+ aStudyBuilder->Addreference(newObj1, SO);
+ IO->setEntry(SO->GetID());
+ }
+ }
+
+ if(!allreadyexist) {
+ vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(S,0,themode,Standard_True);
+ theActors->InitTraversal();
+ vtkActor* anActor = (vtkActor*)theActors->GetNextActor();
+ while(!(anActor==NULL)) {
+ GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
+ GActor->setIO(IO);
+ GActor->setName(nameG);
+ theRenderer->AddActor(GActor);
+ renWin->Render();
+ anActor = (vtkActor*)theActors->GetNextActor();
+ }
+ }
+ }
+ }
+
+ /* commit transaction */
+ op->finish();
+
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
+ return true;
+}
+
+
+//=====================================================================================
+// function : OnSubShapeGetSelected()
+// purpose :
+//=====================================================================================
+bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
+{
+ //* Test the type of viewer */
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ return false;
+
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
+ if(theObj->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ return false;
+ }
+
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+
+ if( myUseLocalContext == false ) {
+ /* local context is from DialogBox */
+ MESSAGE("Error : No local context opened for sub shapes method" << endl ) ;
+ return false ;
+ }
+
+ GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString( ShapeTopoIOR );
+ TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
+
+ TopoDS_Shape mainShape;
+ bool main = false;
+ while(!main) {
+ if(aShape->IsMainShape()) {
+ mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
+ main = true;
+ }
+ else
+ aShape = myGeom->GetIORFromString(aShape->MainName());
+ }
+
+ GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
+ ic->InitSelected();
+ int nbSelected = ic->NbSelected();
+ ListOfID->length(nbSelected);
+
+ TopoDS_Compound compound;
+ ic->InitSelected(); /* to init again */
+ BRep_Builder B;
+ B.MakeCompound(compound);
+
+ int i = 0;
+ /* We create a unique compound containing all the sub shapes selected by user as attribute of the main shape */
+ /* the compound is homogenous by selection */
+ while(ic->MoreSelected()) {
+ int index = myGeomBase->GetIndex(ic->SelectedShape(), mainShape, SubShapeType);
+ ListOfID[i] = index;
+ B.Add(compound, ic->SelectedShape());
+ i++;
+ ic->NextSelected();
+ }
+
+ /* Test if user has selected sub shapes */
+ if(ListOfID->length() < 1)
+ return false;
+
+ GEOM::GEOM_Shape_var aResult;
+ try {
+ aResult = myGeom->SubShape(aShape, SubShapeType, ListOfID);
+ }
+ catch (const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+
+ /* local context from DialogBox */
+ ic->CloseLocalContext(aLocalContextId);
+ myUseLocalContext = false ;
+
+ char* nameG = (char *)malloc(20);
+ Standard_CString Type;
+
+ Handle(GEOM_AISShape) result;
+ Handle(GEOM_InteractiveObject) IO;
+
+ if(nbSelected == 1) {
+ TopExp_Explorer Exp (compound, TopAbs_ShapeEnum(SubShapeType));
+ if(Exp.More()) {
+ if(myGeomBase->GetShapeTypeString(Exp.Current(),Type)) {
+ aResult->NameType(Type);
+ sprintf (nameG, "%s_%d", Type, myGeomBase->GetIndex( Exp.Current(), mainTopo, SubShapeType));
+ }
+ else {
+ aResult->NameType(tr("GEOM_SHAPE"));
+ sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ }
+ result = new GEOM_AISShape(Exp.Current(), nameG);
+ IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
+ }
+ }
+ else {
+ if ( myGeomBase->GetShapeTypeString(compound,Type)) {
+ aResult->NameType(Type);
+ sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
+ } else {
+ aResult->NameType(tr("GEOM_SHAPE"));
+ sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ }
+ result = new GEOM_AISShape(compound, nameG);
+ IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
+ }
+
+ SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
+
+ /* open transaction */
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
+ op->start();
+
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeName_var aName;
+ SALOMEDS::AttributeIOR_var anIOR;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ bool allreadyexist = false;
+
+ if(SO->_is_nil()) {
+ SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(aResult->Name());
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(result->getName());
+
+ anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ if(result->Shape().ShapeType() == TopAbs_COMPOUND)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND");
+ else if(result->Shape().ShapeType() == TopAbs_COMPSOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID");
+ else if(result->Shape().ShapeType() == TopAbs_SOLID)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID");
+ else if(result->Shape().ShapeType() == TopAbs_SHELL)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL");
+ else if(result->Shape().ShapeType() == TopAbs_FACE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_FACE");
+ else if(result->Shape().ShapeType() == TopAbs_WIRE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE");
+ else if(result->Shape().ShapeType() == TopAbs_EDGE)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE");
+ else if(result->Shape().ShapeType() == TopAbs_VERTEX)
+ aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
+
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
+ aStudyBuilder->Addreference(newObj1, newObj);
+
+ IO->setEntry(newObj->GetID());
+ aResult->StudyShapeId(newObj->GetID());
+ }
+ else {
+ allreadyexist = true;
+ if(!this->SObjectExist(theObj, aResult->Name())) {
+ SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
+ aStudyBuilder->Addreference(newObj1, SO);
+
+ IO->setEntry(SO->GetID());
+ aResult->StudyShapeId(SO->GetID());
+ }
+ }
+
+ /* commit transaction */
+ op->finish();
+
+ result->setIO(IO);
+ result->setName(nameG);
+
+ if(!allreadyexist)
+ ic->Display(result);
+
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
+ return true;
+}
+
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+ bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
+ {return EntityGUI::OnGUIEvent(theCommandID, parent);}
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_H
+#define ENTITYGUI_H
+
+#include "GEOMBase.h"
+
+//=================================================================================
+// class : EntityGUI
+// purpose :
+//=================================================================================
+class EntityGUI : public QObject
+{
+ Q_OBJECT /* for QT compatibility */
+
+public :
+ EntityGUI();
+ ~EntityGUI();
+
+ static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
+
+ void OnSketchEnd(TopoDS_Shape myShape);
+
+ void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+ void EraseSimulationShape();
+
+ void MakeInterpolAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
+ void MakeBezierAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
+
+ /* Methods for sub shapes explode */
+ bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
+ bool OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType);
+ bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
+ Standard_Integer& aLocalContextId, bool& myUseLocalContext);
+
+ /* AIS shape used only during topo/geom simulations */
+ Handle(AIS_Shape) mySimulationShape1;
+ Handle(AIS_Shape) mySimulationShape2;
+
+ GEOMBase* myGeomBase;
+ GEOMContext* myGeomGUI;
+ GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
+
+};
+
+#endif
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: ven déc 12 11:17:12 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Sel_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_1Sel_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Sel_QTD::EntityGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Sel_QTD" );
+ resize( 186, 96 );
+ setCaption( trUtf8( "EntityGUI_1Sel_QTD" ) );
+ EntityGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Sel_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 180, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 1, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Sel_QTD::~EntityGUI_1Sel_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: ven déc 12 11:17:12 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SEL_QTD_H
+#define ENTITYGUI_1SEL_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+
+class EntityGUI_1Sel_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Sel_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QPushButton* PushButton1;
+ QLineEdit* LineEdit1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Sel_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SEL_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_1Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_1Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_1Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_1Spin::EntityGUI_1Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_1Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin::~EntityGUI_1Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_1Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_1SPIN_H
+#define ENTITYGUI_1SPIN_H
+
+#include "EntityGUI_1Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_1Spin : public EntityGUI_1Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_1Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+
+};
+
+#endif // ENTITYGUI_1SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_1Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Spin_QTD::EntityGUI_1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_1Spin_QTD" ) );
+ EntityGUI_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin_QTD::~EntityGUI_1Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SPIN_QTD_H
+#define ENTITYGUI_1SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_1Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_2Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_2Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_2Spin::EntityGUI_2Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_2Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin::~EntityGUI_2Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_2SPIN_H
+#define ENTITYGUI_2SPIN_H
+
+#include "EntityGUI_2Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_2Spin : public EntityGUI_2Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_2Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+
+};
+
+#endif // ENTITYGUI_2SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_2Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_2Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_2Spin_QTD::EntityGUI_2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_2Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_2Spin_QTD" ) );
+ EntityGUI_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_2Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin_QTD::~EntityGUI_2Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_2SPIN_QTD_H
+#define ENTITYGUI_2SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_2Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_2Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+
+
+protected:
+ QGridLayout* EntityGUI_2Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_2SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_3Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_3Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_3Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_3Spin::EntityGUI_3Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_3Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+ SpinBox3->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+ SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin::~EntityGUI_3Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_3Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_3SPIN_H
+#define ENTITYGUI_3SPIN_H
+
+#include "EntityGUI_3Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_3Spin : public EntityGUI_3Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+
+};
+
+#endif // ENTITYGUI_3SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_3Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_3Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_3Spin_QTD::EntityGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_3Spin_QTD" );
+ resize( 154, 120 );
+ setCaption( trUtf8( "EntityGUI_3Spin_QTD" ) );
+ EntityGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_3Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addWidget( TextLabel3, 2, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin_QTD::~EntityGUI_3Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_3SPIN_QTD_H
+#define ENTITYGUI_3SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_3Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox3;
+
+
+protected:
+ QGridLayout* EntityGUI_3Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_3SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_4Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_4Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_4Spin::EntityGUI_4Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_4Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+ SpinBox3->close(TRUE);
+ SpinBox4->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+ SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
+
+ SpinBox_DS = new DlgRef_SpinBox(GroupBox1, "SpinBox_DS");
+ Layout1->addWidget(SpinBox_DS, 3, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_4Spin::~EntityGUI_4Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_4SPIN_H
+#define ENTITYGUI_4SPIN_H
+
+#include "EntityGUI_4Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_4Spin : public EntityGUI_4Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+ DlgRef_SpinBox* SpinBox_DS;
+
+};
+
+#endif // ENTITYGUI_4SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:12 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_4Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_4Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_4Spin_QTD::EntityGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_4Spin_QTD" );
+ resize( 154, 148 );
+ setCaption( trUtf8( "EntityGUI_4Spin_QTD" ) );
+ EntityGUI_4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_4Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 4, 1 );
+
+ SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
+ SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox4, 3, 1 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addWidget( TextLabel3, 2, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4->setText( trUtf8( "TL4" ) );
+
+ Layout1->addWidget( TextLabel4, 3, 0 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_4Spin_QTD::~EntityGUI_4Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:12 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_4SPIN_QTD_H
+#define ENTITYGUI_4SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_4Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QSpinBox* SpinBox3;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel2;
+ QSpinBox* SpinBox4;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel4;
+
+
+protected:
+ QGridLayout* EntityGUI_4Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_4SPIN_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir1_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Dir1_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir1_QTD::EntityGUI_Dir1_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir1_QTD" );
+ resize( 131, 123 );
+ setCaption( trUtf8( "EntityGUI_Dir1_QTD" ) );
+ EntityGUI_Dir1_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir1_QTDLayout");
+
+ GroupDir1 = new QButtonGroup( this, "GroupDir1" );
+ GroupDir1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDir1->sizePolicy().hasHeightForWidth() ) );
+ GroupDir1->setTitle( trUtf8( "Direction" ) );
+ GroupDir1->setColumnLayout(0, Qt::Vertical );
+ GroupDir1->layout()->setSpacing( 6 );
+ GroupDir1->layout()->setMargin( 11 );
+ GroupDir1Layout = new QGridLayout( GroupDir1->layout() );
+ GroupDir1Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir12 = new QRadioButton( GroupDir1, "RB_Dir12" );
+ RB_Dir12->setText( trUtf8( "Perpendicular" ) );
+
+ Layout1->addWidget( RB_Dir12, 1, 0 );
+
+ RB_Dir13 = new QRadioButton( GroupDir1, "RB_Dir13" );
+ RB_Dir13->setText( trUtf8( "Tangent" ) );
+
+ Layout1->addWidget( RB_Dir13, 2, 0 );
+
+ RB_Dir11 = new QRadioButton( GroupDir1, "RB_Dir11" );
+ RB_Dir11->setText( trUtf8( "Angle" ) );
+
+ Layout1->addWidget( RB_Dir11, 0, 0 );
+
+ RB_Dir14 = new QRadioButton( GroupDir1, "RB_Dir14" );
+ RB_Dir14->setText( trUtf8( "VX-VY" ) );
+
+ Layout1->addWidget( RB_Dir14, 3, 0 );
+
+ GroupDir1Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir1_QTDLayout->addWidget( GroupDir1, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir11, RB_Dir12 );
+ setTabOrder( RB_Dir12, RB_Dir13 );
+ setTabOrder( RB_Dir13, RB_Dir14 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir1_QTD::~EntityGUI_Dir1_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR1_QTD_H
+#define ENTITYGUI_DIR1_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir1_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir1_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir1_QTD();
+
+ QButtonGroup* GroupDir1;
+ QRadioButton* RB_Dir12;
+ QRadioButton* RB_Dir13;
+ QRadioButton* RB_Dir11;
+ QRadioButton* RB_Dir14;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir1_QTDLayout;
+ QGridLayout* GroupDir1Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR1_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir2_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Dir2_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir2_QTD::EntityGUI_Dir2_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir2_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Dir2_QTD" ) );
+ EntityGUI_Dir2_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir2_QTDLayout");
+
+ GroupDir2 = new QButtonGroup( this, "GroupDir2" );
+ GroupDir2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDir2->sizePolicy().hasHeightForWidth() ) );
+ GroupDir2->setTitle( trUtf8( "Direction" ) );
+ GroupDir2->setColumnLayout(0, Qt::Vertical );
+ GroupDir2->layout()->setSpacing( 6 );
+ GroupDir2->layout()->setMargin( 11 );
+ GroupDir2Layout = new QGridLayout( GroupDir2->layout() );
+ GroupDir2Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir22 = new QRadioButton( GroupDir2, "RB_Dir22" );
+ RB_Dir22->setText( trUtf8( "X" ) );
+
+ Layout1->addWidget( RB_Dir22, 1, 0 );
+
+ RB_Dir23 = new QRadioButton( GroupDir2, "RB_Dir23" );
+ RB_Dir23->setText( trUtf8( "Y" ) );
+
+ Layout1->addWidget( RB_Dir23, 2, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer, 3, 0 );
+
+ RB_Dir21 = new QRadioButton( GroupDir2, "RB_Dir21" );
+ RB_Dir21->setText( trUtf8( "Length" ) );
+
+ Layout1->addWidget( RB_Dir21, 0, 0 );
+
+ GroupDir2Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir2_QTDLayout->addWidget( GroupDir2, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir21, RB_Dir22 );
+ setTabOrder( RB_Dir22, RB_Dir23 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir2_QTD::~EntityGUI_Dir2_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR2_QTD_H
+#define ENTITYGUI_DIR2_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir2_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir2_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir2_QTD();
+
+ QButtonGroup* GroupDir2;
+ QRadioButton* RB_Dir22;
+ QRadioButton* RB_Dir23;
+ QRadioButton* RB_Dir21;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir2_QTDLayout;
+ QGridLayout* GroupDir2Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR2_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Point_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Point_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Point_QTD::EntityGUI_Point_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Point_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Point_QTD" ) );
+ EntityGUI_Point_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Point_QTDLayout");
+
+ GroupPoint = new QButtonGroup( this, "GroupPoint" );
+ GroupPoint->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupPoint->sizePolicy().hasHeightForWidth() ) );
+ GroupPoint->setTitle( trUtf8( "Point" ) );
+ GroupPoint->setColumnLayout(0, Qt::Vertical );
+ GroupPoint->layout()->setSpacing( 6 );
+ GroupPoint->layout()->setMargin( 11 );
+ GroupPointLayout = new QGridLayout( GroupPoint->layout() );
+ GroupPointLayout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Point2 = new QRadioButton( GroupPoint, "RB_Point2" );
+ RB_Point2->setText( trUtf8( "Relative" ) );
+
+ Layout1->addWidget( RB_Point2, 1, 0 );
+
+ RB_Point1 = new QRadioButton( GroupPoint, "RB_Point1" );
+ RB_Point1->setText( trUtf8( "Absolute" ) );
+
+ Layout1->addWidget( RB_Point1, 0, 0 );
+
+ RB_Point3 = new QRadioButton( GroupPoint, "RB_Point3" );
+ RB_Point3->setText( trUtf8( "Selection" ) );
+
+ Layout1->addWidget( RB_Point3, 2, 0 );
+
+ GroupPointLayout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Point_QTDLayout->addWidget( GroupPoint, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Point1, RB_Point2 );
+ setTabOrder( RB_Point2, RB_Point3 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Point_QTD::~EntityGUI_Point_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_POINT_QTD_H
+#define ENTITYGUI_POINT_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Point_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Point_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Point_QTD();
+
+ QButtonGroup* GroupPoint;
+ QRadioButton* RB_Point2;
+ QRadioButton* RB_Point1;
+ QRadioButton* RB_Point3;
+
+
+protected:
+ QGridLayout* EntityGUI_Point_QTDLayout;
+ QGridLayout* GroupPointLayout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_POINT_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Skeleton_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Skeleton_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Skeleton_QTD" );
+ resize( 317, 276 );
+ setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
+ setCaption( trUtf8( "EntityGUI_Skeleton_QTD" ) );
+ EntityGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "EntityGUI_Skeleton_QTDLayout");
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ GroupVal = new QGroupBox( this, "GroupVal" );
+ GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) );
+ GroupVal->setTitle( trUtf8( "" ) );
+
+ Layout1->addWidget( GroupVal, 2, 0 );
+
+ GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
+ GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
+ GroupConstructors->setTitle( trUtf8( "Element Type" ) );
+ GroupConstructors->setColumnLayout(0, Qt::Vertical );
+ GroupConstructors->layout()->setSpacing( 6 );
+ GroupConstructors->layout()->setMargin( 11 );
+ GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
+ GroupConstructorsLayout->setAlignment( Qt::AlignTop );
+
+ Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
+
+ RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" );
+ RadioButton1->setText( trUtf8( "Segment" ) );
+ Layout2->addWidget( RadioButton1 );
+
+ RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" );
+ RadioButton2->setText( trUtf8( "Arc" ) );
+ Layout2->addWidget( RadioButton2 );
+
+ GroupConstructorsLayout->addLayout( Layout2, 0, 0 );
+
+ Layout1->addWidget( GroupConstructors, 0, 0 );
+
+ GroupDest = new QGroupBox( this, "GroupDest" );
+ GroupDest->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest->sizePolicy().hasHeightForWidth() ) );
+ GroupDest->setTitle( trUtf8( "Destination" ) );
+ GroupDest->setColumnLayout(0, Qt::Vertical );
+ GroupDest->layout()->setSpacing( 6 );
+ GroupDest->layout()->setMargin( 11 );
+ GroupDestLayout = new QGridLayout( GroupDest->layout() );
+ GroupDestLayout->setAlignment( Qt::AlignTop );
+
+ Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5");
+
+ GroupDest1 = new QButtonGroup( GroupDest, "GroupDest1" );
+ GroupDest1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest1->sizePolicy().hasHeightForWidth() ) );
+ GroupDest1->setTitle( trUtf8( "Type" ) );
+ GroupDest1->setColumnLayout(0, Qt::Vertical );
+ GroupDest1->layout()->setSpacing( 6 );
+ GroupDest1->layout()->setMargin( 11 );
+ GroupDest1Layout = new QGridLayout( GroupDest1->layout() );
+ GroupDest1Layout->setAlignment( Qt::AlignTop );
+
+ Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
+
+ RB_Dest2 = new QRadioButton( GroupDest1, "RB_Dest2" );
+ RB_Dest2->setText( trUtf8( "Direction" ) );
+
+ Layout4->addWidget( RB_Dest2, 0, 1 );
+
+ RB_Dest1 = new QRadioButton( GroupDest1, "RB_Dest1" );
+ RB_Dest1->setText( trUtf8( "Point" ) );
+
+ Layout4->addWidget( RB_Dest1, 0, 0 );
+
+ GroupDest1Layout->addLayout( Layout4, 0, 0 );
+
+ Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 );
+
+ GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" );
+ GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) );
+ GroupDest2->setTitle( trUtf8( "" ) );
+ GroupDest2->setColumnLayout(0, Qt::Vertical );
+ GroupDest2->layout()->setSpacing( 6 );
+ GroupDest2->layout()->setMargin( 11 );
+ GroupDest2Layout = new QGridLayout( GroupDest2->layout() );
+ GroupDest2Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest2, 1, 0 );
+
+ GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" );
+ GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) );
+ GroupDest3->setTitle( trUtf8( "" ) );
+ GroupDest3->setColumnLayout(0, Qt::Vertical );
+ GroupDest3->layout()->setSpacing( 6 );
+ GroupDest3->layout()->setMargin( 11 );
+ GroupDest3Layout = new QGridLayout( GroupDest3->layout() );
+ GroupDest3Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest3, 1, 1 );
+
+ GroupDestLayout->addLayout( Layout5, 0, 0 );
+
+ Layout1->addWidget( GroupDest, 1, 0 );
+
+ GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
+ GroupButtons->setTitle( trUtf8( "" ) );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 6 );
+ GroupButtons->layout()->setMargin( 11 );
+ GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3");
+
+ buttonEnd = new QPushButton( GroupButtons, "buttonEnd" );
+ buttonEnd->setText( trUtf8( "End Sketch" ) );
+ Layout3->addWidget( buttonEnd );
+
+ buttonClose = new QPushButton( GroupButtons, "buttonClose" );
+ buttonClose->setText( trUtf8( "Close Sketch" ) );
+ Layout3->addWidget( buttonClose );
+ QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout3->addItem( spacer );
+
+ buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+ buttonCancel->setText( trUtf8( "&Cancel" ) );
+ Layout3->addWidget( buttonCancel );
+ GroupButtonsLayout->addLayout( Layout3 );
+
+ Layout1->addWidget( GroupButtons, 3, 0 );
+
+ EntityGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
+
+ // tab order
+ setTabOrder( RadioButton1, RadioButton2 );
+ setTabOrder( RadioButton2, RB_Dest1 );
+ setTabOrder( RB_Dest1, RB_Dest2 );
+ setTabOrder( RB_Dest2, buttonEnd );
+ setTabOrder( buttonEnd, buttonClose );
+ setTabOrder( buttonClose, buttonCancel );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Skeleton_QTD::~EntityGUI_Skeleton_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:07 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_SKELETON_QTD_H
+#define ENTITYGUI_SKELETON_QTD_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QGroupBox;
+class QPushButton;
+class QRadioButton;
+
+class EntityGUI_Skeleton_QTD : public QDialog
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~EntityGUI_Skeleton_QTD();
+
+ QGroupBox* GroupVal;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupDest;
+ QButtonGroup* GroupDest1;
+ QRadioButton* RB_Dest2;
+ QRadioButton* RB_Dest1;
+ QButtonGroup* GroupDest2;
+ QButtonGroup* GroupDest3;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonEnd;
+ QPushButton* buttonClose;
+ QPushButton* buttonCancel;
+
+
+protected:
+ QGridLayout* EntityGUI_Skeleton_QTDLayout;
+ QGridLayout* Layout1;
+ QGridLayout* GroupConstructorsLayout;
+ QHBoxLayout* Layout2;
+ QGridLayout* GroupDestLayout;
+ QGridLayout* Layout5;
+ QGridLayout* GroupDest1Layout;
+ QGridLayout* Layout4;
+ QGridLayout* GroupDest2Layout;
+ QGridLayout* GroupDest3Layout;
+ QHBoxLayout* GroupButtonsLayout;
+ QHBoxLayout* Layout3;
+};
+
+#endif // ENTITYGUI_SKELETON_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "EntityGUI_SketcherDlg.h"
+#include "Sketcher_Profile.hxx"
+
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopoDS_Vertex.hxx>
+
+//=================================================================================
+// class : EntityGUI_SketcherDlg()
+// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the
+// name 'name' and widget flags set to 'f'.
+// The dialog will by default be modeless, unless you set 'modal' to
+// TRUE to construct a modal dialog.
+//=================================================================================
+EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(QWidget* parent, const char* name, EntityGUI* theEntityGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :EntityGUI_Skeleton_QTD(parent, name, modal, fl)
+{
+ if (!name)
+ setName("EntityGUI_SketcherDlg");
+
+ buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
+ buttonEnd->setText(tr("GEOM_BUT_END_SKETCH"));
+ buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
+ GroupVal->close(TRUE);
+ GroupDest2->close(TRUE);
+ GroupDest3->close(TRUE);
+ resize(0, 0);
+
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_SKETCHER_TITLE"));
+
+ GroupConstructors->setTitle(tr("GEOM_SKETCHER_EL"));
+ RadioButton1->setText(tr("GEOM_SKETCHER_SEGMENT"));
+ RadioButton2->setText(tr("GEOM_SKETCHER_ARC"));
+ GroupDest->setTitle(tr("GEOM_SKETCHER_DEST"));
+ GroupDest1->setTitle(tr("GEOM_SKETCHER_TYPE"));
+ RB_Dest1->setText(tr("GEOM_SKETCHER_POINT"));
+ RB_Dest2->setText(tr("GEOM_SKETCHER_DIR"));
+
+ /***************************************************************/
+ GroupPt = new EntityGUI_Point_QTD(GroupDest, "GroupPt");
+ GroupPt->GroupPoint->setTitle(tr("GEOM_SKETCHER_POINT"));
+ GroupPt->RB_Point1->setText(tr("GEOM_SKETCHER_ABS"));
+ GroupPt->RB_Point2->setText(tr("GEOM_SKETCHER_REL"));
+ GroupPt->RB_Point3->setText(tr("GEOM_SKETCHER_SEL"));
+
+ GroupD1 = new EntityGUI_Dir1_QTD(GroupDest, "GroupD1");
+ GroupD1->GroupDir1->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD1->RB_Dir11->setText(tr("GEOM_SKETCHER_ANGLE"));
+ GroupD1->RB_Dir12->setText(tr("GEOM_SKETCHER_PER"));
+ GroupD1->RB_Dir13->setText(tr("GEOM_SKETCHER_TAN"));
+ GroupD1->RB_Dir14->setText(tr("GEOM_SKETCHER_VXVY"));
+
+ GroupD2 = new EntityGUI_Dir2_QTD(GroupDest, "GroupD2");
+ GroupD2->GroupDir2->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD2->RB_Dir21->setText(tr("GEOM_SKETCHER_LENGTH"));
+ GroupD2->RB_Dir22->setText(tr("GEOM_SKETCHER_X"));
+ GroupD2->RB_Dir23->setText(tr("GEOM_SKETCHER_Y"));
+
+ Group1Sel = new EntityGUI_1Sel_QTD(this, "Group1Sel");
+ Group1Sel->TextLabel1->setText(tr("GEOM_SKETCHER_POINT2"));
+ Group1Sel->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Sel->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Sel->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+ Group1Sel->PushButton1->setPixmap(image0);
+
+ Group1Spin = new EntityGUI_1Spin(this, "Group1Spin");
+ Group1Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group2Spin = new EntityGUI_2Spin(this, "Group2Spin");
+ Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group2Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group3Spin = new EntityGUI_3Spin(this, "Group3Spin");
+ Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group3Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group4Spin = new EntityGUI_4Spin(this, "Group4Spin");
+ Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group4Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1);
+ Layout5->addWidget(GroupD1, 1, 0);
+ Layout5->addWidget(GroupD2, 1, 1);
+
+ Layout1->addWidget(Group1Sel, 2, 0);
+ Layout1->addWidget(Group1Spin, 2, 0);
+ Layout1->addWidget(Group2Spin, 2, 0);
+ Layout1->addWidget(Group3Spin, 2, 0);
+ Layout1->addWidget(Group4Spin, 2, 0);
+ /***************************************************************/
+
+ mySelection = Sel;
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+ myEntityGUI = theEntityGUI;
+
+ /* Get setting of step value from file configuration */
+ QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
+ step = St.toDouble();
+
+ myGeomBase = new GEOMBase();
+ myGeomGUI = GEOMContext::GetGeomGUI();
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ myGeom = myGeomGUI->myComponentGeom;
+
+ myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
+ mySelection->AddFilter(myVertexFilter);
+
+ /* signals and slots connections */
+ connect(buttonEnd, SIGNAL(clicked()), this, SLOT(ClickOnEnd()));
+ connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+
+ connect(Group1Sel->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Sel->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group1Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group2Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group2Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group3Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group3Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group4Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group4Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(TypeClicked(int)));
+ connect(GroupDest1, SIGNAL(clicked(int)), this, SLOT(DestClicked(int)));
+ connect(GroupPt->GroupPoint, SIGNAL(clicked(int)), this, SLOT(PointClicked(int)));
+ connect(GroupD1->GroupDir1, SIGNAL(clicked(int)), this, SLOT(Dir1Clicked(int)));
+ connect(GroupD2->GroupDir2, SIGNAL(clicked(int)), this, SLOT(Dir2Clicked(int)));
+
+ connect(Group1Sel->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(Group1Sel->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(Group1Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DS, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DS, SLOT(SetStep(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
+ /* Move widget on the botton right corner of main widget */
+// int x, y;
+// myGeomBase->DefineDlgPosition( this, x, y );
+
+ myEntityGUI = theEntityGUI;
+ this->Init();
+ this->show();
+}
+
+
+//=================================================================================
+// function : ~EntityGUI_SketcherDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+ this->destroy(TRUE, TRUE);
+}
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::Init()
+{
+ /* init variables */
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+
+ /* min, max, step and decimals for spin boxes */
+ Group1Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DS->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+
+ Group1Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DX->SetValue(0.0);
+ Group3Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DX->SetValue(0.0);
+ Group4Spin->SpinBox_DY->SetValue(0.0);
+ Group4Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DS->SetValue(0.0);
+
+ /* displays Dialog */
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ buttonEnd->setFocus();
+ RadioButton1->setChecked(true);
+
+ myLastOp = 0;
+ myLastX1 = 0.0;
+ myLastY1 = 0.0;
+ myLastX2 = 0.0;
+ myLastY2 = 0.0;
+
+ mySketchState = FIRST_POINT;
+ this->TypeClicked(0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : InitClick()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::InitClick()
+{
+ disconnect(mySelection, 0, this, 0);
+
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+
+ Group1Sel->hide();
+ Group1Spin->hide();
+ Group2Spin->hide();
+ Group3Spin->hide();
+ Group4Spin->hide();
+
+ resize(0, 0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : TypeClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::TypeClicked(int constructorId)
+{
+ myConstructorId = constructorId;
+ if(myConstructorId == 0) { // SEGMENT
+ GroupD2->setEnabled(true);
+ RB_Dest1->setEnabled(true);
+ RB_Dest1->setChecked(true);
+ this->DestClicked(1);
+ }
+ else if(myConstructorId == 1) { // ARC
+ GroupD2->setEnabled(false);
+ RB_Dest1->setEnabled(false);
+ RB_Dest2->setChecked(true);
+ this->DestClicked(0);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : DestClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::DestClicked(int constructorId)
+{
+ GroupPt->hide();
+ GroupD1->hide();
+ GroupD2->hide();
+
+ if(constructorId == 1) { // Point
+ GroupPt->RB_Point1->setChecked(true);
+ GroupPt->show();
+ this->PointClicked(1); // XY
+ }
+ else if(constructorId == 0) { // Direction
+ GroupD1->RB_Dir11->setChecked(true);
+ GroupD1->show();
+ GroupD2->show();
+ this->Dir1Clicked(2); // Angle
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : PointClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::PointClicked(int constructorId)
+{
+ this->InitClick();
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(constructorId == 1) { // XY
+ mySketchType = PT_ABS;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
+ myX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myX);
+ myY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ Group2Spin->show();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 0) { // DXDY
+ mySketchType = PT_RELATIVE;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
+ myDX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myDY);
+ Group2Spin->show();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 2) { // Selection
+ mySketchType = PT_SEL;
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ Group1Sel->show();
+ this->SelectionIntoArgument();
+ }
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : Dir1Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir1Clicked(int constructorId)
+{
+ myConstructorDirId = constructorId;
+ GroupD2->RB_Dir21->setChecked(true);
+ this->Dir2Clicked(2);
+ return;
+}
+
+
+//=================================================================================
+// function : Dir2Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
+{
+ this->InitClick();
+ myAngle = 0.0;
+
+ if(myConstructorId == 0) { // SEGMENT
+ myX = 0.0;
+ myY = 0.0;
+ myLength = 100.0;
+ if(myConstructorDirId == 2) { // Angle
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group2Spin->SpinBox_DX->SetValue(myAngle);
+ Group2Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_ANGLE_X;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_X3"));
+ Group2Spin->SpinBox_DY->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_ANGLE_Y;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3"));
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ Group1Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_PER_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_PER_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ Group1Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_TAN_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_TAN_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ myDX = 0.0;
+ Group3Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group3Spin->SpinBox_DY->SetValue(myDY);
+ Group3Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_DXDY_X;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_X3"));
+ Group3Spin->SpinBox_DZ->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_DXDY_Y;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_Y3"));
+ Group3Spin->SpinBox_DZ->SetValue(myY);
+ }
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(myConstructorDirId == 2) { // Angle
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->SpinBox_DX->SetValue(myAngle);
+ myRadius = 100.0;
+ Group3Spin->SpinBox_DY->SetValue(myRadius);
+ myLength = 30.0;
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ Group3Spin->show();
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group4Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group4Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ Group4Spin->TextLabel3->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group4Spin->TextLabel4->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myDX = 0.0;
+ Group4Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group4Spin->SpinBox_DY->SetValue(myDY);
+ myRadius = 100.0;
+ Group4Spin->SpinBox_DZ->SetValue(myRadius);
+ myLength = 30.0;
+ Group4Spin->SpinBox_DS->SetValue(myLength);
+ Group4Spin->show();
+ }
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnCancel()
+{
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+
+ reject();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnEnd()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnEnd()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT)
+ myEntityGUI->OnSketchEnd(myShape);
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnClose()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnClose()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT) {
+ myCommand = myCommand + ":WW";
+
+ Sketcher_Profile aProfile (myCommand.ascii());
+
+ if(aProfile.IsDone()) {
+ myShape = aProfile.GetShape();
+ myEntityGUI->OnSketchEnd(myShape);
+ }
+ }
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnApply()
+{
+ if(mySketchState == FIRST_POINT) {
+ mySketchState = SECOND_POINT;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ }
+ else {
+ if(mySketchState != SECOND_POINT) {
+ Group1Sel->buttonUndo->setEnabled(true);
+ Group1Spin->buttonUndo->setEnabled(true);
+ Group2Spin->buttonUndo->setEnabled(true);
+ Group3Spin->buttonUndo->setEnabled(true);
+ Group4Spin->buttonUndo->setEnabled(true);
+ }
+
+ QString myNewCommand = this->GetNewCommand();
+ QString myCommandTemp = myCommand + myNewCommand;
+
+ Sketcher_Profile aProfile (myCommandTemp.ascii());
+
+ if(aProfile.IsDone()) {
+ myLastCommand = myCommand;
+ myCommand = myCommandTemp;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ mySketchState = NEXT_POINT;
+ }
+ }
+
+ myLastOp = myConstructorId;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnUndo()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnUndo()
+{
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ myCommand = myLastCommand;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed
+//=================================================================================
+void EntityGUI_SketcherDlg::SelectionIntoArgument()
+{
+ myEditCurrentArgument->setText("");
+ QString aString = "";
+
+ myX = 0.0;
+ myY = 0.0;
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1) {
+ this->MakeSimulationAndDisplay();
+ return;
+ }
+
+ /* nbSel == 1 */
+ TopoDS_Shape S;
+ gp_Pnt myPoint1;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S)) {
+ this->MakeSimulationAndDisplay();
+ return;
+ }
+
+ if(myEditCurrentArgument == Group1Sel->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
+ myX = myPoint1.X();
+ myY = myPoint1.Y();
+ Group1Sel->LineEdit1->setText(aString);
+ }
+
+ this->MakeSimulationAndDisplay();
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ mySelection->ClearFilters();
+ if(send == Group1Sel->PushButton1) {
+ Group1Sel->LineEdit1->setFocus();
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ }
+ mySelection->AddFilter(myVertexFilter);
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::LineEditReturnPressed()
+{
+ /* User name of object input management */
+ /* If successfull the selection is changed and signal emitted... */
+ /* so SelectionIntoArgument() is automatically called. */
+ const QString objectUserName = myEditCurrentArgument->text();
+ QWidget* thisWidget = (QWidget*)this;
+ if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
+ myEditCurrentArgument->setText(objectUserName);
+
+ return;
+}
+
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::DeactivateActiveDialog()
+{
+ this->setEnabled(false);
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+ myEntityGUI->EraseSimulationShape();
+ myGeomGUI->SetActiveDialogBox(0);
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ActivateThisDialog()
+{
+ /* Emit a signal to deactivate the active dialog */
+ myGeomGUI->EmitSignalDeactivateDialog();
+ this->setEnabled(true);
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ mySelection->AddFilter(myVertexFilter);
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent [REDEFINED]
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::enterEvent(QEvent* e)
+{
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : closeEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e)
+{
+ /* same than click on cancel button */
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
+{
+ QObject* send = (QObject*)sender();
+ Standard_Real vx, vy, vz, vs;
+ vx = vy = vz = vs = 0.0;
+
+ if(send == Group1Spin->SpinBox_DX) {
+ vx = newValue;
+ }
+ else if(send == Group2Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group2Spin->SpinBox_DY->GetValue();
+ }
+ else if(send == Group2Spin->SpinBox_DY) {
+ vx = Group2Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ }
+ else if(send == Group3Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ }
+ else if(send == Group3Spin->SpinBox_DY) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ }
+ else if(send == Group3Spin->SpinBox_DZ) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ }
+ else if(send == Group4Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if(send == Group4Spin->SpinBox_DY) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if(send == Group4Spin->SpinBox_DZ) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if(send == Group4Spin->SpinBox_DS) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = newValue;
+ }
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS) {
+ myX = vx;
+ myY = vy;
+ }
+ else if(mySketchType == PT_RELATIVE) {
+ myDX = vx;
+ myDY = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_X) {
+ myAngle = vx;
+ myX = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_Y) {
+ myAngle = vx;
+ myY = vy;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_PER_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_PER_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_TAN_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_TAN_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_DXDY_X) {
+ myDX = vx;
+ myDY = vy;
+ myX = vz;
+ }
+ else if(mySketchType == DIR_DXDY_Y) {
+ myDX = vx;
+ myDY = vy;
+ myY = vz;
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myRadius = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myRadius = vz;
+ myLength = vs;
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : MakeSimulationAndDisplay()
+// purpose :
+//=================================================================================
+QString EntityGUI_SketcherDlg::GetNewCommand()
+{
+ QString myNewCommand = "";
+ if(mySketchState == FIRST_POINT)
+ return myNewCommand;
+
+ myNewCommand = ":";
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS || mySketchType == PT_SEL)
+ myNewCommand = myNewCommand + "TT " + QString::number(myX) + " " + QString::number(myY);
+ if(mySketchType == PT_RELATIVE)
+ myNewCommand = myNewCommand + "T " + QString::number(myDX) + " " + QString::number(myDY);
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_ANGLE_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_ANGLE_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_PER_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_TAN_LENGTH)
+ myNewCommand = myNewCommand + "L " + QString::number(myLength);
+ if(mySketchType == DIR_TAN_X)
+ myNewCommand = myNewCommand + "IX " + QString::number(myX);
+ if(mySketchType == DIR_TAN_Y)
+ myNewCommand = myNewCommand + "IY " + QString::number(myY);
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_X) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_DXDY_Y) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_TAN_LENGTH) {
+ myNewCommand = myNewCommand + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ }
+ return myNewCommand;
+}
+
+
+//=================================================================================
+// function : MakeSimulationAndDisplay()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::MakeSimulationAndDisplay()
+{
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ try {
+ if(mySketchState == FIRST_POINT) {
+ myCommand = "Sketch ";
+ myCommand = myCommand + ":" + "F " + QString::number(myX) + " " + QString::number(myY);
+
+ myLastX1 = myX;
+ myLastY1 = myY;
+ }
+
+ Sketcher_Profile aProfile1 (myCommand.ascii());
+
+ if(aProfile1.IsDone()) {
+ myShape = aProfile1.GetShape();
+ mySimulationTopoDs1 = myShape;
+ }
+
+ if(mySketchState != FIRST_POINT) {
+ if(mySketchState == SECOND_POINT) {
+ gp_Pnt pt = BRep_Tool::Pnt(TopoDS::Vertex(myShape));
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ }
+ else {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(TopoDS::Wire(myShape), V1, V2);
+ gp_Pnt pt = BRep_Tool::Pnt(V2);
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ if(myLastOp == 1) { // ARC
+ myLastDir = aProfile1.GetLastDir();
+ myLastX2 = myLastX1 - myLastDir.X();
+ myLastY2 = myLastY1 - myLastDir.Y();
+ }
+ }
+ QString myNewCommand = "Sketch ";
+ myNewCommand = myNewCommand + ":" + "F " + QString::number(myLastX1) + " " + QString::number(myLastY1);
+ if(mySketchState != SECOND_POINT && !((myLastX1 - myLastX2) == 0 && (myLastY1 - myLastY2) == 0))
+ myNewCommand = myNewCommand + ":" + "D " + QString::number(myLastX1 - myLastX2) + " " + QString::number(myLastY1 - myLastY2);
+ myNewCommand = myNewCommand + this->GetNewCommand();
+ Sketcher_Profile aProfile2 (myNewCommand.ascii());
+ if(aProfile2.IsDone())
+ mySimulationTopoDs2 = aProfile2.GetShape();
+ }
+
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in MakSimulationAndDisplay");
+ return;
+ }
+ return;
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.h
+// Author : Damine COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_SKETCHERDLG_H
+#define ENTITYGUI_SKETCHERDLG_H
+
+#include "EntityGUI_Skeleton_QTD.h"
+#include "EntityGUI_Point_QTD.h"
+#include "EntityGUI_Dir1_QTD.h"
+#include "EntityGUI_Dir2_QTD.h"
+
+#include "EntityGUI_1Sel_QTD.h"
+#include "EntityGUI_1Spin.h"
+#include "EntityGUI_2Spin.h"
+#include "EntityGUI_3Spin.h"
+#include "EntityGUI_4Spin.h"
+
+#include "EntityGUI.h"
+
+#include "GEOM_ShapeTypeFilter.hxx"
+
+#include <gp_Dir.hxx>
+
+#include <qwidget.h>
+#include <qgroupbox.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+
+//=================================================================================
+// class : EntityGUI_Dlg
+// purpose :
+//=================================================================================
+class EntityGUI_SketcherDlg : public EntityGUI_Skeleton_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_SketcherDlg(QWidget* parent = 0, const char* name = 0, EntityGUI* theEntityGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EntityGUI_SketcherDlg();
+
+private :
+ void Init();
+ void enterEvent(QEvent* e);
+ void closeEvent(QCloseEvent* e);
+ void InitClick();
+ void MakeSimulationAndDisplay();
+ QString GetNewCommand();
+
+ EntityGUI* myEntityGUI;
+
+ double step;
+ int myConstructorId;
+ int myConstructorDirId;
+ int mySketchType;
+ int mySketchState;
+ Handle(GEOM_ShapeTypeFilter) myVertexFilter;
+
+ TopoDS_Shape mySimulationTopoDs1; /* Shape used for simulation display */
+ TopoDS_Shape mySimulationTopoDs2; /* Shape used for simulation display */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ SALOME_Selection* mySelection; /* User shape selection */
+ GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
+ GEOMBase* myGeomBase;
+ GEOMContext* myGeomGUI; /* Current GeomGUI object */
+
+ int myLastOp;
+ QString myCommand;
+ QString myLastCommand;
+ TopoDS_Shape myShape;
+ gp_Dir myLastDir;
+
+ Standard_Real myX;
+ Standard_Real myY;
+ Standard_Real myDX;
+ Standard_Real myDY;
+ Standard_Real myLastX1;
+ Standard_Real myLastY1;
+ Standard_Real myLastX2;
+ Standard_Real myLastY2;
+ Standard_Real myLength;
+ Standard_Real myAngle;
+ Standard_Real myRadius;
+
+ EntityGUI_Point_QTD* GroupPt;
+ EntityGUI_Dir1_QTD* GroupD1;
+ EntityGUI_Dir2_QTD* GroupD2;
+
+ EntityGUI_1Sel_QTD* Group1Sel;
+ EntityGUI_1Spin* Group1Spin;
+ EntityGUI_2Spin* Group2Spin;
+ EntityGUI_3Spin* Group3Spin;
+ EntityGUI_4Spin* Group4Spin;
+
+ enum SketchState {FIRST_POINT, SECOND_POINT, NEXT_POINT};
+
+ enum SketchType {PT_ABS, PT_RELATIVE, PT_SEL,
+ DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
+ DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
+ DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
+ DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y};
+
+private slots:
+ void ClickOnEnd();
+ void ClickOnClose();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnUndo();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void TypeClicked(int constructorId);
+ void DestClicked(int constructorId);
+ void PointClicked(int constructorId);
+ void Dir1Clicked(int constructorId);
+ void Dir2Clicked(int constructorId);
+ void ValueChangedInSpinBox(double newValue);
+
+};
+
+#endif // ENTITYGUI_SKETCHERDLG_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SplineDlg.cxx
+// Author : Lucien PIGNOLONI
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "EntityGUI_SplineDlg.h"
+
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <GeomAPI_PointsToBSpline.hxx>
+#include <BRep_Tool.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+
+//=================================================================================
+// class : EntityGUI_SplineDlg()
+// purpose : Constructs a EntityGUI_SplineDlg which is a child of 'parent', with the
+// name 'name' and widget flags set to 'f'.
+// The dialog will by default be modeless, unless you set 'modal' to
+// TRUE to construct a modal dialog.
+//=================================================================================
+EntityGUI_SplineDlg::EntityGUI_SplineDlg(QWidget* parent, const char* name, EntityGUI* theEntityGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BEZIER")));
+ QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_INTERPOL")));
+ QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_SPLINE_TITLE"));
+
+ /***************************************************************/
+ GroupConstructors->setTitle(tr("GEOM_SPLINE"));
+ RadioButton1->setPixmap(image0);
+ RadioButton2->setPixmap(image1);
+ RadioButton3->close(TRUE);
+
+ GroupBezier = new DlgRef_1Sel_QTD(this, "GroupBezier");
+ GroupBezier->GroupBox1->setTitle(tr("GEOM_BEZIER"));
+ GroupBezier->TextLabel1->setText(tr("GEOM_POINTS"));
+ GroupBezier->PushButton1->setPixmap(image2);
+
+ GroupInterpol = new DlgRef_1Sel_QTD(this, "GroupInterpol");
+ GroupInterpol->GroupBox1->setTitle(tr("GEOM_INTERPOL"));
+ GroupInterpol->TextLabel1->setText(tr("GEOM_POINTS"));
+ GroupInterpol->PushButton1->setPixmap(image2);
+
+ Layout1->addWidget(GroupBezier, 1, 0);
+ Layout1->addWidget(GroupInterpol, 1, 0);
+ /***************************************************************/
+
+ /* Initialisations */
+ myEntityGUI = theEntityGUI;
+ Init();
+}
+
+
+//=================================================================================
+// function : ~EntityGUI_SplineDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+EntityGUI_SplineDlg::~EntityGUI_SplineDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::Init()
+{
+ /* init variables */
+ myConstructorId = 0;
+ myEditCurrentArgument = GroupBezier->LineEdit1;
+ myOkListShapes = false;
+
+ /* Vertices Filter for all arguments */
+ myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
+ mySelection->AddFilter(myVertexFilter);
+
+ /* signals and slots connections */
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
+
+ connect(GroupBezier->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupInterpol->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ /* displays Dialog */
+ GroupInterpol->hide();
+ GroupBezier->show();
+ this->show();
+
+ return;
+}
+
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SplineDlg::ConstructorsClicked(int constructorId)
+{
+ myConstructorId = constructorId;
+ mySelection->ClearFilters();
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+ disconnect(mySelection, 0, this, 0);
+ myOkListShapes = false;
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ GroupInterpol->hide();
+ resize(0, 0);
+ GroupBezier->show();
+
+ myEditCurrentArgument = GroupBezier->LineEdit1;
+ GroupBezier->LineEdit1->setText("");
+ break;
+ }
+ case 1:
+ {
+ GroupBezier->hide();
+ resize(0, 0);
+ GroupInterpol->show();
+
+ myEditCurrentArgument = GroupInterpol->LineEdit1;
+ GroupInterpol->LineEdit1->setText("");
+ break;
+ }
+ }
+ /* filter for next selection */
+ mySelection->AddFilter(myVertexFilter);
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::ClickOnOk()
+{
+ this->ClickOnApply();
+ ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::ClickOnApply()
+{
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ if (mySimulationTopoDs.IsNull())
+ return;
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+
+ switch(myConstructorId)
+ {
+ case 0 :
+ {
+ if(myOkListShapes)
+ myEntityGUI->MakeBezierAndDisplay(myListShapes);
+ break;
+ }
+ case 1 :
+ {
+ if(myOkListShapes)
+ myEntityGUI->MakeInterpolAndDisplay(myListShapes);
+ break;
+ }
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed or other case
+//=================================================================================
+void EntityGUI_SplineDlg::SelectionIntoArgument()
+{
+ myGeomBase->EraseSimulationShape();
+ myEditCurrentArgument->setText("");
+ QString aString = ""; /* name of selection */
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel < 2) {
+ myOkListShapes = false;
+ return;
+ }
+
+ myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
+ myEditCurrentArgument->setText(aString);
+ myOkListShapes = true;
+
+ this->MakeSplineSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ if(send == GroupBezier->PushButton1) {
+ GroupBezier->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupBezier->LineEdit1;
+ }
+ else if(send == GroupInterpol->PushButton1) {
+ GroupInterpol->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupInterpol->LineEdit1;
+ }
+ mySelection->AddFilter(myVertexFilter);
+ this->SelectionIntoArgument();
+
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ mySelection->AddFilter(myVertexFilter);
+ if(!mySimulationTopoDs.IsNull())
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::enterEvent(QEvent* e)
+{
+ if (GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : MakeSplineSimulationAndDisplay()
+// purpose :
+//=================================================================================
+void EntityGUI_SplineDlg::MakeSplineSimulationAndDisplay()
+{
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+
+ if(!myOkListShapes)
+ return;
+
+ try {
+ TColgp_Array1OfPnt CurvePoints(1, myListShapes.length());
+ SALOME_ListIteratorOfListIO It(mySelection->StoredIObjects());
+ int i = 1;
+ for(;It.More(); It.Next()) {
+ Standard_Boolean found;
+ Handle(GEOM_AISShape) AISShape = myGeomBase->ConvertIOinGEOMAISShape(It.Value(), found);
+ if(!found)
+ return;
+ TopoDS_Shape Shape = AISShape->Shape();
+ if(Shape.IsNull())
+ return;
+ if(Shape.ShapeType() == TopAbs_VERTEX) {
+ const gp_Pnt& P = BRep_Tool::Pnt(TopoDS::Vertex(Shape));
+ CurvePoints.SetValue(i, P);
+ }
+ i++;
+ }
+ switch(myConstructorId)
+ {
+ case 0 :
+ {
+ Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
+ mySimulationTopoDs = BRepBuilderAPI_MakeEdge(GBC);
+ break;
+ }
+ case 1 :
+ {
+ GeomAPI_PointsToBSpline GBC(CurvePoints);
+ mySimulationTopoDs = BRepBuilderAPI_MakeEdge(GBC);
+ break;
+ }
+ }
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in MakeSplineSimulationAndDisplay");
+ return;
+ }
+ return;
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SplineDlg.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef DIALOGBOX_SPLINE_H
+#define DIALOGBOX_SPLINE_H
+
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_1Sel_QTD.h"
+
+#include "EntityGUI.h"
+
+#include "GEOM_ShapeTypeFilter.hxx"
+
+//=================================================================================
+// class : EntityGUI_WireDlg
+// purpose :
+//=================================================================================
+class EntityGUI_SplineDlg : public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_SplineDlg(QWidget* parent = 0, const char* name = 0, EntityGUI* theEntityGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EntityGUI_SplineDlg();
+
+private:
+ void Init();
+ void enterEvent(QEvent* e);
+ void MakeSplineSimulationAndDisplay();
+
+ EntityGUI* myEntityGUI;
+
+ int myConstructorId;
+ Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */
+
+ GEOM::GEOM_Gen::ListOfIOR myListShapes;
+ bool myOkListShapes; /* to check when arguments is defined */
+
+ DlgRef_1Sel_QTD* GroupBezier;
+ DlgRef_1Sel_QTD* GroupInterpol;
+
+private slots:
+ void ClickOnOk();
+ void ClickOnApply();
+ void ActivateThisDialog();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked(int constructorId);
+
+};
+
+#endif // DIALOGBOX_SPLINE_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SubShapeDlg.cxx
+// Author : Lucien PIGNOLONI
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "EntityGUI_SubShapeDlg.h"
+
+#include "DisplayGUI.h"
+#include "QAD_RightFrame.h"
+#include "OCCViewer_Viewer3d.h"
+
+#include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+#include <qmessagebox.h>
+
+//=================================================================================
+// class : EntityGUI_SubShapeDlg()
+// purpose : Constructs a EntityGUI_SubShapeDlg which is a child of 'parent', with the
+// name 'name' and widget flags set to 'f'.
+// The dialog will by default be modeless, unless you set 'modal' to
+// TRUE to construct a modal dialog.
+//=================================================================================
+EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(QWidget* parent, const char* name, EntityGUI* theEntityGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
+ :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SUBSHAPE")));
+ QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_SUBSHAPE_TITLE"));
+
+ /***************************************************************/
+ GroupConstructors->setTitle(tr("GEOM_SUB_SHAPE"));
+ RadioButton1->setPixmap(image0);
+ RadioButton2->close(TRUE);
+ RadioButton3->close(TRUE);
+
+ GroupPoints = new DlgRef_1Sel1Check1List_QTD(this, "GroupPoints");
+ GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
+ GroupPoints->TextLabel2->setText(tr("GEOM_SUBSHAPE_TYPE"));
+ GroupPoints->CheckButton1->setText(tr("GEOM_SUBSHAPE_SELECT"));
+ GroupPoints->PushButton1->setPixmap(image1);
+
+ Layout1->addWidget(GroupPoints, 1, 0);
+ /***************************************************************/
+
+ /* Initialisations */
+ myEntityGUI = theEntityGUI;
+ Init(ic);
+}
+
+
+//=================================================================================
+// function : ~EntityGUI_SubShapeDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::Init(Handle(AIS_InteractiveContext) ic)
+{
+ /* init variables */
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+
+ myWithShape = true;
+ myAbort = myOkShape = myUseLocalContext = false;
+ myIC = ic;
+ myLocalContextId = -1;
+
+ /* type for sub shape selection */
+ GroupPoints->ComboBox1->insertItem("Compound");
+ GroupPoints->ComboBox1->insertItem("Compsolid");
+ GroupPoints->ComboBox1->insertItem("Solid");
+ GroupPoints->ComboBox1->insertItem("Shell");
+ GroupPoints->ComboBox1->insertItem("Face");
+ GroupPoints->ComboBox1->insertItem("Wire");
+ GroupPoints->ComboBox1->insertItem("Edge");
+ GroupPoints->ComboBox1->insertItem("Vertex");
+ GroupPoints->ComboBox1->insertItem("Shape");
+
+ myShapeType = GroupPoints->ComboBox1->currentItem();
+ myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
+ GroupPoints->CheckButton1->setEnabled(false);
+
+ /* signals and slots connections */
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+ connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+
+ connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
+ connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(AllOrNotAll()));
+
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ /* displays Dialog */
+ GroupPoints->show();
+ this->show();
+
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnOk()
+{
+ this->ClickOnApply();
+
+ /* User has aborted or not operation of explode all with many sub shapes */
+ if(myAbort == false)
+ this->ClickOnCancel();
+ else
+ myAbort = false;
+
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnApply()
+{
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ bool testResult = false;
+ myAbort = false; /* Not aborted by default */
+
+ /* Explode all sub shapes */
+ if(myOkShape && !myOkSelectSubMode) {
+ /* More than 30 subshapes : ask confirmation */
+ unsigned int nb = NumberOfSubShapes(myShape, myShapeType);
+ if(nb > 30) {
+ const QString caption = tr("GEOM_CONFIRM");
+ const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
+ const QString button0 = tr("GEOM_BUT_EXPLODE");
+ const QString button1 = tr("GEOM_BUT_CANCEL");
+
+ if(QMessageBox::warning(this, caption, text, button0, button1) == 0)
+ testResult = myEntityGUI->OnSubShapeGetAll(myShape, myShapeIOR, myShapeType);
+ else
+ myAbort = true; /* aborted */
+ }
+ else
+ testResult = myEntityGUI->OnSubShapeGetAll(myShape, myShapeIOR, myShapeType);
+ }
+ /* explode only selected sub shapes */
+ else if(myOkShape && myOkSelectSubMode)
+ testResult = myEntityGUI->OnSubShapeGetSelected(myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext);
+
+ if(!testResult) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ myAbort = true;
+ }
+ else
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+
+ /* Reset all arguments and local context to allow user a new selection ...*/
+ this->ResetStateOfDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnCancel()
+{
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ }
+ GEOMBase_Skeleton::ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed or other case
+// : used only by SelectButtonC1A1 (LineEditC1A1)
+//=================================================================================
+void EntityGUI_SubShapeDlg::SelectionIntoArgument()
+{
+ myEditCurrentArgument->setText("");
+ this->ResetStateOfDialog();
+ QString aString = ""; /* name of selection */
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1) {
+ myOkShape = false;
+ return;
+ }
+
+ /* nbSel == 1 */
+ TopoDS_Shape S;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S))
+ return;
+
+ if(!IO->hasEntry()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ return;
+ }
+
+ if(!S.IsNull() && S.ShapeType() != TopAbs_VERTEX) {
+ if(IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
+ Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO );
+ myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
+ myEditCurrentArgument->setText(aString);
+ myShape = S;
+ myOkShape = true;
+ }
+ else {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeIOR_var anIOR;
+ if(!obj->_is_nil()) {
+ if(obj->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ myShapeIOR = anIOR->Value();
+ myOkShape = true;
+ myShape = S;
+ GroupPoints->LineEdit1->setText(aString);
+ }
+ }
+ }
+
+ int SelectedShapeType = GroupPoints->ComboBox1->currentItem();
+ int count = GroupPoints->ComboBox1->count();
+
+ if(myWithShape)
+ count = count - 1;
+
+ int i = 0;
+ while(i <= myShape.ShapeType()) {
+ GroupPoints->ComboBox1->removeItem(0);
+ i++;
+ }
+
+ if(myShape.ShapeType()==TopAbs_COMPOUND) {
+ if(myWithShape == false) {
+ GroupPoints->ComboBox1->insertItem("Shape");
+ myWithShape = true;
+ }
+ }
+ else {
+ if(myWithShape == true) {
+ GroupPoints->ComboBox1->removeItem(GroupPoints->ComboBox1->count() - 1);
+ myWithShape = false;
+ }
+ }
+
+ int count1 = GroupPoints->ComboBox1->count();
+ if(myWithShape)
+ count1 = count1 - 1;
+
+ if(SelectedShapeType > myShape.ShapeType()) {
+ if(SelectedShapeType == 8) {
+ if(myShape.ShapeType() != TopAbs_COMPOUND) {
+ GroupPoints->ComboBox1->setCurrentItem(0);
+ myShapeType = 8 - count1;
+ }
+ }
+ else {
+ GroupPoints->ComboBox1->setCurrentItem(count1 - count + SelectedShapeType);
+ myShapeType = 8 - count1 + GroupPoints->ComboBox1->currentItem();
+ }
+ }
+ else {
+ GroupPoints->ComboBox1->setCurrentItem(0);
+ myShapeType = 8 - count1;
+ }
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ if(send == GroupPoints->PushButton1) {
+ GroupPoints->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ }
+ this->SelectionIntoArgument();
+
+ return;
+}
+
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if(send == GroupPoints->LineEdit1)
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ else
+ return;
+
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ return;
+}
+
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::DeactivateActiveDialog()
+{
+ if(GroupConstructors->isEnabled()) {
+ this->ResetStateOfDialog();
+ GEOMBase_Skeleton::DeactivateActiveDialog();
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ GroupPoints->CheckButton1->setEnabled(true);
+ else
+ GroupPoints->CheckButton1->setEnabled(false);
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::enterEvent(QEvent* e)
+{
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : closeEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::closeEvent(QCloseEvent* e)
+{
+ /* same than click on cancel button */
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ResetStateOfDialog()
+// purpose : Completely reset the state of method including local context
+//=================================================================================
+void EntityGUI_SubShapeDlg::ResetStateOfDialog()
+{
+ if(myAbort == true) {
+ myOkShape = false;
+ myEditCurrentArgument->setText("");
+ }
+
+ int SelectedShapeType = GroupPoints->ComboBox1->currentItem();
+ int count = GroupPoints->ComboBox1->count();
+ if(myWithShape)
+ count = count - 1;
+
+ /* type for sub shape selection */
+ GroupPoints->ComboBox1->clear();
+ GroupPoints->ComboBox1->insertItem("Compound");
+ GroupPoints->ComboBox1->insertItem("Compsolid");
+ GroupPoints->ComboBox1->insertItem("Solid");
+ GroupPoints->ComboBox1->insertItem("Shell");
+ GroupPoints->ComboBox1->insertItem("Face");
+ GroupPoints->ComboBox1->insertItem("Wire");
+ GroupPoints->ComboBox1->insertItem("Edge");
+ GroupPoints->ComboBox1->insertItem("Vertex");
+ GroupPoints->ComboBox1->insertItem("Shape");
+ myWithShape=true;
+ GroupPoints->ComboBox1->setCurrentItem(8 - count + SelectedShapeType);
+ myOkSelectSubMode = false;
+
+ /* unpress buttons : due to abort box*/
+ buttonApply->setDown(FALSE);
+ buttonOk->setDown(FALSE);
+ GroupPoints->CheckButton1->setChecked(FALSE);
+
+ /* Close its local contact if opened */
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : AllOrNotAll()
+// purpose : Allow user selection of all or only selected sub shapes
+// : Called when 'CheckButton1' state change
+//=================================================================================
+void EntityGUI_SubShapeDlg::AllOrNotAll()
+{
+ /* No sub shape selection if main shape not selected */
+ if(!myOkShape) {
+ this->ResetStateOfDialog();
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
+ return;
+ }
+
+ if(myShapeType ==TopAbs_SHAPE && myShape.ShapeType()==TopAbs_COMPOUND) {
+ /* Select sub shapes mode not checked */
+ myOkSelectSubMode = false;
+ GroupPoints->CheckButton1->setChecked( FALSE );
+ //no meaning to allow user selection for type = shape
+ //TODO - add another message
+ //QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
+ return;
+ }
+
+ myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ }
+ else {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
+ return;
+ }
+
+ if(myOkShape && myOkSelectSubMode) {
+ /* local context is defined into the method */
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);
+ myUseLocalContext = true;
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : ComboTextChanged()
+// purpose :
+//=================================================================================
+void EntityGUI_SubShapeDlg::ComboTextChanged()
+{
+ if(myOkShape)
+ myShapeType = GroupPoints->ComboBox1->currentItem() + myShape.ShapeType() + 1;
+ else
+ myShapeType = GroupPoints->ComboBox1->currentItem();
+
+ /* Select sub shapes mode not checked */
+ GroupPoints->CheckButton1->setChecked(FALSE);
+ myOkSelectSubMode = FALSE;
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : NumberOfSubShapes()
+// purpose :
+//=================================================================================
+unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType)
+{
+ if(S.IsNull())
+ return 0;
+
+ unsigned int index = 0;
+ TopExp_Explorer Exp(S, TopAbs_ShapeEnum(shapeType));
+ TopTools_MapOfShape M;
+ while(Exp.More()) {
+ if(M.Add(Exp.Current()))
+ index++;
+ Exp.Next();
+ }
+ M.Clear();
+ return index;
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SubShapeDlg.h
+// Author : Lucien PIGNOLONI
+// Module : GEOM
+// $Header$
+
+#ifndef DIALOGBOX_SUBSHAPE_H
+#define DIALOGBOX_SUBSHAPE_H
+
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_1Sel1Check1List_QTD.h"
+
+#include "EntityGUI.h"
+
+//=================================================================================
+// class : EntityGUI_SubShapeDlg
+// purpose :
+//=================================================================================
+class EntityGUI_SubShapeDlg : public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_SubShapeDlg(QWidget* parent = 0, const char* name = 0, EntityGUI* theEntityGUI = 0, SALOME_Selection* Sel = 0, Handle(AIS_InteractiveContext) ic = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EntityGUI_SubShapeDlg();
+
+private :
+ void Init(Handle(AIS_InteractiveContext) ic);
+ void enterEvent(QEvent* e);
+ void closeEvent(QCloseEvent* e);
+
+ void ResetStateOfDialog();
+ unsigned int NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType);
+
+ EntityGUI* myEntityGUI;
+
+ /* Interactive and local context management see also : bool myUseLocalContext() */
+ Handle(AIS_InteractiveContext) myIC; /* Interactive context */
+ Standard_Integer myLocalContextId; /* identify a local context used by this method */
+ bool myUseLocalContext; /* true when this method as opened a local context */
+
+ TopoDS_Shape myShape;
+ bool myOkShape;
+ char* myShapeIOR;
+ int myShapeType;
+
+ bool myWithShape; /* check if Shape item exists */
+ bool myOkSelectSubMode; /* true = sub mode selection activated */
+ bool myAbort; /* Indicate if sub Shape All has been aborted by user */
+
+ DlgRef_1Sel1Check1List_QTD* GroupPoints;
+
+private slots:
+ void ClickOnOk();
+ void ClickOnApply();
+ void ClickOnCancel();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void AllOrNotAll();
+ void ComboTextChanged();
+
+};
+
+#endif // DIALOGBOX_SUBSHAPE_H
--- /dev/null
+# GEOM ENTITYGUI :
+#
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+#
+#
+#
+# File : Makefile.in
+# Author : Damien COQUERET (OCC)
+# Module : GEOM
+# $Header:
+
+top_srcdir=@top_srcdir@
+top_builddir=../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@:@top_srcdir@/idl
+
+
+@COMMENCE@
+
+# Libraries targets
+LIB = libEntityGUI.la
+
+# header files
+EXPORT_HEADERS=
+
+LIB_SRC = EntityGUI.cxx \
+ EntityGUI_Skeleton_QTD.cxx \
+ EntityGUI_Point_QTD.cxx \
+ EntityGUI_Dir1_QTD.cxx \
+ EntityGUI_Dir2_QTD.cxx \
+ EntityGUI_1Sel_QTD.cxx \
+ EntityGUI_1Spin_QTD.cxx \
+ EntityGUI_2Spin_QTD.cxx \
+ EntityGUI_3Spin_QTD.cxx \
+ EntityGUI_4Spin_QTD.cxx \
+ EntityGUI_1Spin.cxx \
+ EntityGUI_2Spin.cxx \
+ EntityGUI_3Spin.cxx \
+ EntityGUI_4Spin.cxx \
+ EntityGUI_SketcherDlg.cxx \
+ EntityGUI_SplineDlg.cxx \
+ EntityGUI_SubShapeDlg.cxx
+
+LIB_MOC = \
+ EntityGUI.h \
+ EntityGUI_Skeleton_QTD.h \
+ EntityGUI_Point_QTD.h \
+ EntityGUI_Dir1_QTD.h \
+ EntityGUI_Dir2_QTD.h \
+ EntityGUI_1Sel_QTD.h \
+ EntityGUI_1Spin_QTD.h \
+ EntityGUI_2Spin_QTD.h \
+ EntityGUI_3Spin_QTD.h \
+ EntityGUI_4Spin_QTD.h \
+ EntityGUI_1Spin.h \
+ EntityGUI_2Spin.h \
+ EntityGUI_3Spin.h \
+ EntityGUI_4Spin.h \
+ EntityGUI_SketcherDlg.h \
+ EntityGUI_SplineDlg.h \
+ EntityGUI_SubShapeDlg.h
+
+LIB_CLIENT_IDL =
+
+LIB_SERVER_IDL =
+
+# additionnal information to compil and link file
+
+CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
+
+LDFLAGS += -lGEOMSketcher -lGEOMFiltersSelection -lDisplayGUI
+
+@CONCLUDE@
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_1Sel_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_1Sel_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>186</width>
+ <height>96</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_1Sel_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonUndo</cstring>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>Create</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>180</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_1Spin_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_1Spin_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>154</width>
+ <height>96</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_1Spin_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonUndo</cstring>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>Create</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>82</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_2Spin_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_2Spin_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>154</width>
+ <height>96</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_2Spin_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonUndo</cstring>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>Create</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>82</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_3Spin_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_3Spin_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>154</width>
+ <height>120</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_3Spin_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonUndo</cstring>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>Create</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>82</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>SpinBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_4Spin_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_4Spin_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>154</width>
+ <height>148</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_4Spin_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonUndo</cstring>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>Create</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>SpinBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="3" column="1">
+ <property name="name">
+ <cstring>SpinBox4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL4</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_Dir1_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_Dir1_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>131</width>
+ <height>123</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_Dir1_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>GroupDir1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>RB_Dir12</cstring>
+ </property>
+ <property name="text">
+ <string>Perpendicular</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>RB_Dir13</cstring>
+ </property>
+ <property name="text">
+ <string>Tangent</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>RB_Dir11</cstring>
+ </property>
+ <property name="text">
+ <string>Angle</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>RB_Dir14</cstring>
+ </property>
+ <property name="text">
+ <string>VX-VY</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>RB_Dir11</tabstop>
+ <tabstop>RB_Dir12</tabstop>
+ <tabstop>RB_Dir13</tabstop>
+ <tabstop>RB_Dir14</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_Dir2_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_Dir2_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>106</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_Dir2_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>GroupDir2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>RB_Dir22</cstring>
+ </property>
+ <property name="text">
+ <string>X</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>RB_Dir23</cstring>
+ </property>
+ <property name="text">
+ <string>Y</string>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>RB_Dir21</cstring>
+ </property>
+ <property name="text">
+ <string>Length</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>RB_Dir21</tabstop>
+ <tabstop>RB_Dir22</tabstop>
+ <tabstop>RB_Dir23</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_Point_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EntityGUI_Point_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>106</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_Point_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>GroupPoint</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Point</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>RB_Point2</cstring>
+ </property>
+ <property name="text">
+ <string>Relative</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>RB_Point1</cstring>
+ </property>
+ <property name="text">
+ <string>Absolute</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>RB_Point3</cstring>
+ </property>
+ <property name="text">
+ <string>Selection</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>RB_Point1</tabstop>
+ <tabstop>RB_Point2</tabstop>
+ <tabstop>RB_Point3</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EntityGUI_Skeleton_QTD</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EntityGUI_Skeleton_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>317</width>
+ <height>276</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>EntityGUI_Skeleton_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>GroupVal</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>GroupConstructors</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Element Type</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RadioButton1</cstring>
+ </property>
+ <property name="text">
+ <string>Segment</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RadioButton2</cstring>
+ </property>
+ <property name="text">
+ <string>Arc</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>GroupDest</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Destination</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupDest1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Type</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="0" column="1">
+ <property name="name">
+ <cstring>RB_Dest2</cstring>
+ </property>
+ <property name="text">
+ <string>Direction</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>RB_Dest1</cstring>
+ </property>
+ <property name="text">
+ <string>Point</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>GroupDest2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>GroupDest3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0">
+ <property name="name">
+ <cstring>GroupButtons</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonEnd</cstring>
+ </property>
+ <property name="text">
+ <string>End Sketch</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonClose</cstring>
+ </property>
+ <property name="text">
+ <string>Close Sketch</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>91</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>RadioButton1</tabstop>
+ <tabstop>RadioButton2</tabstop>
+ <tabstop>RB_Dest1</tabstop>
+ <tabstop>RB_Dest2</tabstop>
+ <tabstop>buttonEnd</tabstop>
+ <tabstop>buttonClose</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
--- /dev/null
+#!/bin/sh
+
+uic -o EntityGUI_Skeleton_QTD.h EntityGUI_Skeleton_QTD.ui
+uic -o EntityGUI_Skeleton_QTD.cxx -impl EntityGUI_Skeleton_QTD.h EntityGUI_Skeleton_QTD.ui
+
+uic -o EntityGUI_Point_QTD.h EntityGUI_Point_QTD.ui
+uic -o EntityGUI_Point_QTD.cxx -impl EntityGUI_Point_QTD.h EntityGUI_Point_QTD.ui
+
+uic -o EntityGUI_Dir1_QTD.h EntityGUI_Dir1_QTD.ui
+uic -o EntityGUI_Dir1_QTD.cxx -impl EntityGUI_Dir1_QTD.h EntityGUI_Dir1_QTD.ui
+
+uic -o EntityGUI_Dir2_QTD.h EntityGUI_Dir2_QTD.ui
+uic -o EntityGUI_Dir2_QTD.cxx -impl EntityGUI_Dir2_QTD.h EntityGUI_Dir2_QTD.ui
+
+uic -o EntityGUI_1Spin_QTD.h EntityGUI_1Spin_QTD.ui
+uic -o EntityGUI_1Spin_QTD.cxx -impl EntityGUI_1Spin_QTD.h EntityGUI_1Spin_QTD.ui
+
+uic -o EntityGUI_2Spin_QTD.h EntityGUI_2Spin_QTD.ui
+uic -o EntityGUI_2Spin_QTD.cxx -impl EntityGUI_2Spin_QTD.h EntityGUI_2Spin_QTD.ui
+
+uic -o EntityGUI_3Spin_QTD.h EntityGUI_3Spin_QTD.ui
+uic -o EntityGUI_3Spin_QTD.cxx -impl EntityGUI_3Spin_QTD.h EntityGUI_3Spin_QTD.ui
+
+uic -o EntityGUI_4Spin_QTD.h EntityGUI_4Spin_QTD.ui
+uic -o EntityGUI_4Spin_QTD.cxx -impl EntityGUI_4Spin_QTD.h EntityGUI_4Spin_QTD.ui
+
+uic -o EntityGUI_1Sel_QTD.h EntityGUI_1Sel_QTD.ui
+uic -o EntityGUI_1Sel_QTD.cxx -impl EntityGUI_1Sel_QTD.h EntityGUI_1Sel_QTD.ui
#include "Partition_Spliter.hxx"
#include "Archimede_VolumeSection.hxx"
+#include "Sketcher_Profile.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
}
+//=================================================================================
+// function : MakeSketcher()
+// purpose : Make a wire from a list containing many points
+//=================================================================================
+GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSketcher( const char *Cmd )
+ throw (SALOME::SALOME_Exception)
+{
+ GEOM::GEOM_Shape_var result ;
+ TopoDS_Shape tds ;
+ try {
+ Sketcher_Profile aProfile (Cmd);
+ if(aProfile.IsDone())
+ tds = aProfile.GetShape();
+ }
+ catch(Standard_Failure) {
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::MakeBox", SALOME::BAD_PARAM);
+ }
+
+ if (tds.IsNull()) {
+ THROW_SALOME_CORBA_EXCEPTION("Make Box aborted : null shape", SALOME::BAD_PARAM);
+ }
+ else {
+ result = CreateObject(tds);
+ const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
+ result->ShapeId(entry) ;
+ }
+ return result;
+}
+
+
//=================================================================================
// function : MakeBezier()
// purpose : Make a wire from a list containing many points
//=================================================================================
-// function : MakeBSpline()
+// function : MakeInterpol()
// purpose : Make a wire from a list containing many points
//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeBSpline( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
+GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeInterpol( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
GEOM::GEOM_Shape_var result;
GEOM::GEOM_Shape_ptr MakeSolid (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
+
+ //-------------------------------------------------------------------//
+ // Speciic method Sketcher //
+ //-------------------------------------------------------------------//
+ GEOM::GEOM_Shape_ptr MakeSketcher (const char* Cmd)
+ throw (SALOME::SALOME_Exception) ;
+
+
+ //-------------------------------------------------------------------//
+ // Speciic method Spline //
+ //-------------------------------------------------------------------//
GEOM::GEOM_Shape_ptr MakeBezier (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
- GEOM::GEOM_Shape_ptr MakeBSpline (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
+ GEOM::GEOM_Shape_ptr MakeInterpol (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
msgstr "bezier.png"
#SplineDlg
-msgid "ICON_DLG_BSPLINE"
-msgstr "bspline.png"
+msgid "ICON_DLG_INTERPOL"
+msgstr "interpol.png"
msgstr "Spline"
msgid "GEOM_BEZIER"
msgstr "Bezier"
-msgid "GEOM_BSPLINE"
-msgstr "BSpline"
+msgid "GEOM_INTERPOL"
+msgstr "Interpolation"
+
+#
+#==============================================================================
+#
+
+msgid "GEOM_SKETCHER_EL"
+msgstr "Element Type"
+
+msgid "GEOM_BUT_CLOSE_SKETCH"
+msgstr "Close Sketcher"
+
+msgid "GEOM_BUT_END_SKETCH"
+msgstr "End Sketcher"
+
+msgid "GEOM_SKETCHER_TITLE"
+msgstr "Spline Construction"
+
+msgid "GEOM_SKETCHER_POINT"
+msgstr "Point"
+
+msgid "GEOM_SKETCHER_SEGMENT"
+msgstr "Segment"
+
+msgid "GEOM_SKETCHER_ARC"
+msgstr "Arc"
+
+msgid "GEOM_SKETCHER_DIR"
+msgstr "Direction"
+
+msgid "GEOM_SKETCHER_POINT2"
+msgstr "Point :"
+
+msgid "GEOM_SKETCHER_DEST"
+msgstr "Destination"
+
+msgid "GEOM_SKETCHER_ABS"
+msgstr "Absolute"
+
+msgid "GEOM_SKETCHER_REL"
+msgstr "Relative"
+
+msgid "GEOM_SKETCHER_SEL"
+msgstr "Selection"
+
+msgid "GEOM_SKETCHER_ANGLE"
+msgstr "Angle"
+
+msgid "GEOM_SKETCHER_PER"
+msgstr "Perpendicular"
+
+msgid "GEOM_SKETCHER_TAN"
+msgstr "Tangent"
+
+msgid "GEOM_SKETCHER_VXVY"
+msgstr "VX-VY"
+
+msgid "GEOM_SKETCHER_LENGTH"
+msgstr "Length"
+
+msgid "GEOM_SKETCHER_X"
+msgstr "X"
+
+msgid "GEOM_SKETCHER_Y"
+msgstr "Y"
+
+msgid "GEOM_SKETCHER_X2"
+msgstr "X :"
+
+msgid "GEOM_SKETCHER_Y2"
+msgstr "Y :"
+
+msgid "GEOM_SKETCHER_X3"
+msgstr "Abs. X :"
+
+msgid "GEOM_SKETCHER_Y3"
+msgstr "Abs. Y :"
+
+msgid "GEOM_SKETCHER_DX2"
+msgstr "DX :"
+
+msgid "GEOM_SKETCHER_DY2"
+msgstr "DY :"
+
+msgid "GEOM_SKETCHER_VX2"
+msgstr "VX :"
+
+msgid "GEOM_SKETCHER_VY2"
+msgstr "VY :"
+
+msgid "GEOM_SKETCHER_LENGTH2"
+msgstr "Length :"
+
+msgid "GEOM_SKETCHER_ANGLE2"
+msgstr "Angle :"
+
+msgid "GEOM_SKETCHER_RADIUS2"
+msgstr "Radius :"
+
+msgid "GEOM_SKETCHER_UNDO"
+msgstr "Undo"
+
+msgid "GEOM_SKETCHER_APPLY"
+msgstr "Apply"
+
+msgid "GEOM_SKETCHER_VALUES"
+msgstr "Values"
+
+msgid "GEOM_SKETCHER_TYPE"
+msgstr "Type"
if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
return false;
}
- else if(theCommandID == 404) { // SKETCHER
- if(!GeomGUI->LoadLibrary("libSketcherGUI.so"))
+ else if(theCommandID == 404 || // MENU ENTITY - SKETCHER
+ theCommandID == 406 || // MENU ENTITY - SPLINE
+ theCommandID == 407) { // MENU ENTITY - EXPLODE
+ if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
return false;
}
- else if(theCommandID == 406 || // MENU BUILD - SPLINE
- theCommandID == 407 || // MENU BUILD - EXPLODE
- theCommandID == 4081 || // MENU BUILD - EDGE
+ else if(theCommandID == 4081 || // MENU BUILD - EDGE
theCommandID == 4082 || // MENU BUILD - WIRE
theCommandID == 4083 || // MENU BUILD - FACE
theCommandID == 4084 || // MENU BUILD - SHELL
@COMMENCE@
-SUBDIRS = OBJECT ARCHIMEDE PARTITION GEOMDS GEOM GEOMClient GEOMFiltersSelection DlgRef GEOMContext GEOMBase DisplayGUI GEOMToolsGUI SketcherGUI BasicGUI PrimitiveGUI GenerationGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GEOMGUI GEOM_SWIG
+SUBDIRS = OBJECT ARCHIMEDE PARTITION SKETCHER GEOMDS GEOM GEOMClient GEOMFiltersSelection DlgRef GEOMContext GEOMBase DisplayGUI GEOMToolsGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GEOMGUI GEOM_SWIG
@MODULE@
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Sketcher.cxx
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Sketcher.h"
-#include "utilities.h"
-
-#include <qstring.h>
-
-#include <Geom_Axis1Placement.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_CartesianPoint.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepBuilderAPI_MakeEdge2d.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <gp_Lin2d.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Circ2d.hxx>
-#include <gp_Vec2d.hxx>
-#include <IntAna_IntConicQuad.hxx>
-#include <BRepLib.hxx>
-#include <TopExp.hxx>
-#include <ProjLib.hxx>
-#include <Precision.hxx>
-#include <ElSLib.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <GccAna_Pnt2dBisec.hxx>
-#include <GeomAPI.hxx>
-#include <Geom2dAPI_ProjectPointOnCurve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-#include <Geom2d_Circle.hxx>
-#include <gce_MakeCirc2d.hxx>
-#include <GccAna_Circ2d2TanRad.hxx>
-#include <GccAna_Circ2d2TanOn.hxx>
-#include <GccEnt.hxx>
-#include <GccEnt_QualifiedLin.hxx>
-#include <GccEnt_QualifiedCirc.hxx>
-#include <GccAna_Lin2dTanPer.hxx>
-#include <GccAna_Lin2dTanObl.hxx>
-#include <gce_MakeLin2d.hxx>
-#include <GCE2d_MakeArcOfCircle.hxx>
-#include <Precision.hxx>
-#include <ElCLib.hxx>
-#include <AIS_Point.hxx>
-#include <TColgp_HArray1OfPnt2d.hxx>
-#include <Geom2dAPI_Interpolate.hxx>
-#include <TColgp_Array1OfVec2d.hxx>
-#include <TColStd_HArray1OfBoolean.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <DsgPrs_ArrowSide.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-
-#include <AIS_Drawer.hxx>
-#include <Prs3d_TextAspect.hxx>
-#include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_NameOfFont.hxx>
-
-#include <TopoDS_Wire.hxx>
-
-/*!
- \class GEOM_Sketcher GEOM_Sketcher.h
- \brief ...
-*/
-
-Standard_Real resol = 1.0;
-
-/*!
- Constructor.
-*/
-Sketch::Sketch()
-{
-
-}
-
-/*!
- Destructor.
-*/
-Sketch::~Sketch()
-{
-
-}
-
-
-/*!
- Constructor.
-
- \param V3d_Viewer
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer) :
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(Quantity_Color(Quantity_NOC_YELLOW)),
-myCurrentColor(Quantity_Color(Quantity_NOC_GREEN)),
-myWireColor(Quantity_Color(Quantity_NOC_RED))
-{
- Init();
-}
-
-/*!
- Constructor.
-
- \param V3d_Viewer
- \param Quantity_Color
- \param Quantity_Color
- \param Quantity_Color
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor):
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(anAxisColor),
-myCurrentColor(aCurrentColor),
-myWireColor(aWireColor)
-{
- Init();
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param Xp
- \param Yp
- \param V3d_View
-*/
-void Sketch::MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView )
-{
- /* 3d coordinates of the picked point */
- Standard_Real Xv,Yv,Zv;
- aView->Convert(Xp,Yp,Xv,Yv,Zv);
- /* computation of real 2d coordinates in plane of sketch */
- Standard_Real Vx,Vy,Vz;
- aView->Proj(Vx,Vy,Vz);
- gp_Dir D(Vx,Vy,Vz);
- gp_Pnt P(Xv,Yv,Zv);
- gp_Lin L(P,D);
- Standard_Real X,Y;
- gp_Pnt Sol;
- IntAna_IntConicQuad Int(L,myPlane->Pln(),Precision::Angular());
- if (Int.IsDone()) {
- if (!Int.IsParallel()) {
- if (Int.NbPoints() > 0 ) {
- Sol = Int.Point(1);
- ElSLib::Parameters(myPlane->Pln(),Sol,X,Y);
- }
- }
- }
- MakeCurrentEdge(X,Y);
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentEdge(const Standard_Real X, const Standard_Real Y)
-{
- /* Create the current edge depending on the active mode */
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- myCurrentEdge = BRepBuilderAPI_MakeVertex(ElCLib::To3d(myPlane->Pln().Position().Ax2(),gp_Pnt2d(X,Y)));
- break;
- case SEGMENT:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD_END:
- MakeCurrentArc(X,Y);
- break;
- }
- DisplayCurrentEdge();
-}
-
-/*!
- Build the current edge in a graphic mode.
- Function to connect to the input event from the user interface.
-*/
-void Sketch::ValidateEdge()
-{
- gp_Pnt pt;
- gp_Pnt2d pt2d;
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- {
- myFirstPointSketch = TopoDS::Vertex(myCurrentEdge);
- myPresentableWire = new AIS_Shape(myFirstPointSketch);
- myPresentableWire->SetColor(myWireColor.Name());
- myInteractiveContext->Display(myPresentableWire);
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myCurrentStatus = SEGMENT;
- break;
- }
- case SEGMENT:
- {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,myLengthDimension->Value());
- if (myTransitionStatus == ANGLE ||
- myTransitionStatus == LENGTH_FIXED ||
- myTransitionStatus == X_FIXED ||
- myTransitionStatus == Y_FIXED)
- myTransitionStatus = NOCONSTRAINT;
- AddEdgeToWire();
- break;
- }
- case ARC_CHORD:
- {
- myInteractiveContext->CloseLocalContext();
- myInteractiveContext->OpenLocalContext();
- gp_Pnt2d p1 (myLastX,myLastY);
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myCurrentEdge)));
- gp_Pnt2d p2 = ProjLib::Project(myPlane->Pln(),pt);
- GccAna_Pnt2dBisec ComputeMediatrice(p1,p2);
- if (ComputeMediatrice.HasSolution()) {
- myMediatrice = new Geom2d_Line(ComputeMediatrice.ThisSolution());
- Handle(Geom_Curve) aMediatrice3d = GeomAPI::To3d(myMediatrice,myPlane->Pln());
- myPresentableMediatrice = new AIS_Axis(Handle(Geom_Line)::DownCast(aMediatrice3d));
- myInteractiveContext->Display(myPresentableMediatrice);
- }
- TopoDS_Edge e = BRepBuilderAPI_MakeEdge2d(gce_MakeCirc2d(gp_Pnt2d(0.,0),1.));
- BRepLib::BuildCurve3d(e);
- myLengthDimension->SetText(TCollection_ExtendedString());
- myInteractiveContext->Redisplay(myLengthDimension,Standard_False);
- if (myEdgesNumber == 0)
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myTransitionStatus = NOCONSTRAINT;
- myCurrentStatus = ARC_CHORD_END;
- break;
- }
- case ARC_CHORD_END:
- myCurrentStatus = ARC_CHORD;
- AddEdgeToWire();
- break;
- }
-}
-
-/*!
- Add edge to current wire on an edge validation .
-*/
-void Sketch::AddEdgeToWire()
-{
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- BRepLib::BuildCurve3d(myPreviousEdge);
- myCurrentWire.Add(TopoDS::Edge(myPreviousEdge));
- myEdgesNumber++;
- myPresentableWire->Set( myCurrentWire.Wire() );
- myInteractiveContext->Redisplay(myPresentableWire);
- myConstructionMode.Append(myCurrentStatus);
- myConstraintMode.Append(myTransitionStatus);
- myInteractiveContext->CloseLocalContext();
- gp_Pnt pt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param aValue
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::SetDimension(Standard_Real& aValue)
-{
- fitInResol(aValue);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD){
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge =
- BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,aValue);
- DisplayCurrentEdge();
- if (myTransitionStatus == NOCONSTRAINT) {
- mySegmentLength = aValue;
- myTransitionStatus = LENGTH_FIXED;
- }
- else
- ValidateEdge();
- return Standard_True;
- }
-
- else if( myCurrentStatus == ARC_CHORD_END){
- if (myTransitionStatus == TANGENT) return Standard_False;
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- GccAna_Circ2d2TanRad aSol(p, gp_Pnt2d(myLastX,myLastY),aValue,Precision::Confusion());
- Standard_Real dist = RealLast();
- if (aSol.NbSolutions() > 0) {
- gp_Circ2d CirSol;
- gp_Pnt2d pc = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopoDS::Vertex(myCenterCircle->Shape())));
- for (Standard_Integer i =1; i<= aSol.NbSolutions(); i++) {
- if (pc.Distance(aSol.ThisSolution(i).Location()) < dist)
- CirSol = aSol.ThisSolution(i);
- }
- if (myCurrentEdge.Orientation() == TopAbs_FORWARD)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- DisplayCurrentEdge();
- ValidateEdge();
- return Standard_True;
- }
- }
-
- return Standard_False;
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param deltaX
- \param deltaY
-*/
-void Sketch::SetDimension(Standard_Real& deltaX, Standard_Real& deltaY)
-{
- fitInResol(deltaX);
- fitInResol(deltaY);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY + deltaY;
- MakeCurrentEdge(X,Y);
- ValidateEdge();
-}
-
-/*!
- Set the numeric value of the X coordinate of current point giving a deltaX relative to previous point.
-
- \param deltaX
-*/
-void Sketch::SetXDimension(Standard_Real& deltaX)
-{
- fitInResol(deltaX);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY;
- if ( deltaX == 0. )
- Y = Y + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = X_FIXED;
- mySegmentX = X;
- }
- else if (myTransitionStatus == Y_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(X,mySegmentY);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- Y = X*Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of the Y coordinate of current point giving a deltaY relative to previous point.
-
- \param deltaY
-*/
-void Sketch::SetYDimension(Standard_Real& deltaY)
-{
- fitInResol(deltaY);
- Standard_Real X = myLastX;
- Standard_Real Y = myLastY + deltaY;
-
- if ( deltaY == 0. )
- X = X + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = Y_FIXED;
- mySegmentY = Y;
- }
- else if (myTransitionStatus == X_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(mySegmentX,Y);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- X = Y/Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of angle between 2 segments.
-
- \param aValue
-*/
-void Sketch::SetSegmentAngle(Standard_Real& aValue)
-{
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Standard_Real angle;
- if (0 <= aValue && aValue<= PI )
- angle = PI - aValue;
- else
- angle = aValue - PI;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
-
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),0.,myLengthDimension->Value());
- }
- if (myTransitionStatus == LENGTH_FIXED) {
- ValidateEdge();
- }
- else if (myTransitionStatus == X_FIXED) {
- Standard_Real length = mySegmentX/Cos(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else if (myTransitionStatus == Y_FIXED) {
- Standard_Real length = mySegmentY/Sin(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else {
- mySegmentAngle = aValue;
- myTransitionStatus = ANGLE;
- }
- }
-}
-
-/*!
- Get the angle value between 2 segments.
-
- \return Standard_Real
-*/
-Standard_Real Sketch::GetSegmentAngle()
-{
- return mySegmentAngle;
-}
-
-/*!
- Close automatically an open sketch.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::Close()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myEdgesNumber >= 2) {
- BRepTools_WireExplorer Ex(myCurrentWire.Wire());
- TopoDS_Vertex V1;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- V1 = TopExp::LastVertex(myPreviousEdge);
- else
- V1 = TopExp::FirstVertex(myPreviousEdge);
- myCurrentWire.Add(BRepBuilderAPI_MakeEdge(V1,myFirstPointSketch).Edge());
- myEdgesNumber++;
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-
-/*!
- Clear sketch presentation.
-*/
-void Sketch::Clear()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
-}
-
-/*!
- Terminate sketch without closing.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::End()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myCurrentWire.IsDone()) {
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-/*!
- Delete current edge.
-*/
-Standard_Boolean Sketch::Delete()
-{
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-
- if (myCurrentStatus == BEGIN_SKETCH) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return true;
- }
- else if(myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- RemoveLastEdge();
- }
- else if(myCurrentStatus == ARC_CHORD_END) {
- myCurrentStatus = ARC_CHORD;
- myInteractiveContext->CloseAllContexts();
- }
- gp_Pnt pt;
- if (myEdgesNumber == 0) {
- //myInteractiveContext->EraseAll(Standard_False);
- ChangeMode(BEGIN_SKETCH); // DCQ
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- }
- else {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- }
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-
- return false;
-}
-
-/*!
- Set a specific plane for sketch.
-
- \param GeomyPlane
-*/
-void Sketch::SetPlane(const Handle(Geom_Plane)& aPlane)
-{
- myPlane = aPlane;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetWireColor(const Quantity_Color& aColor)
-{
- myWireColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetCurrentColor(const Quantity_Color& aColor)
-{
- myCurrentColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetAxisColor(const Quantity_Color& aColor)
-{
- myAxisColor = aColor;
-}
-
-
-/*!
- Change mode of construction line.
-
- \param aMode : SEGMENT, ARC_CHORD.
-*/
-void Sketch::ChangeMode(const SketchStatus aMode)
-{
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext(myInteractiveContext->IndexOfCurrentLocal());
- }
- if (!myCurrentStatus == BEGIN_SKETCH)
- myCurrentStatus = aMode; /* change the mode only when the sketch is not in state BEGIN_SKETCH, i.d. fist point has been fixed */
-
-}
-
-/*!
- Set transition constraint between consecutive edges.
-
- \param aStatus : NOCONSTRAINT, TANGENT, PERPENDICULAR, ANGLE, LENGTH_FIXED, X_FIXED, Y_FIXED.
-*/
-void Sketch::SetTransitionStatus(const TransitionStatus aStatus)
-{
- myTransitionStatus = aStatus;
-}
-
-/*!
- Set or unset the display of dimensions.
-
- \param atype
- \param OnOff
-*/
-void Sketch::SetParameterVisibility(const TypeOfParameter atype, const Standard_Boolean OnOff)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myIsAngleDimensionVisible = OnOff;
- if (!myIsAngleDimensionVisible && !myAngleDimension.IsNull())
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case LENGTH_PARAMETER:
- myIsLengthDimensionVisible = OnOff;
- if (!myIsLengthDimensionVisible&& !myLengthDimension.IsNull())
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case RADIUS_PARAMETER:
- myIsRadiusDimensionVisible = OnOff;
- if (!myIsRadiusDimensionVisible&& !myRadiusDimension.IsNull()){
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- }
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case XVALUE_PARAMETER:
- myIsXDimensionVisible = OnOff;
- if (!myIsXDimensionVisible&& !myXDimension.IsNull())
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- break;
- case YVALUE_PARAMETER:
- myIsYDimensionVisible = OnOff;
- if (!myIsYDimensionVisible&& !myYDimension.IsNull())
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
- break;
- }
-}
-
-/*!
- Hilight parameters.
-
- \param atype
- \param acolor
-*/
-void Sketch::HiligthWithColor(const TypeOfParameter atype, const Quantity_NameOfColor acolor)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->HilightWithColor(myAngleDimension, acolor);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->HilightWithColor(myLengthDimension, acolor);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->HilightWithColor(myRadiusDimension, acolor);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myXDimension, acolor);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myYDimension, acolor);
- break;
- }
-}
-
-
-/*!
- Unhilight parameters.
-
- \param atype
-*/
-void Sketch::Unhiligth(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->Unhilight(myAngleDimension);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->Unhilight(myLengthDimension);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->Unhilight(myRadiusDimension);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myXDimension);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myYDimension);
- break;
- }
-}
-
-/*!
- Check if the edition of a type of parameter is relevant depending on sketch current status.
-
- \param atype
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::IsValidCurrentParameter(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- if (myCurrentStatus != SEGMENT && myCurrentStatus != ARC_CHORD)
- return Standard_False;
- else if (myTransitionStatus == TANGENT || myTransitionStatus == PERPENDICULAR)
- return Standard_False;
- else if (myEdgesNumber < 1)
- return Standard_False;
- else {
- TopLoc_Location L;
- Standard_Real First,Last;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (!PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)))
- return Standard_False;
- }
- break;
- case LENGTH_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == LENGTH_FIXED)
- return Standard_False;
- break;
- case RADIUS_PARAMETER:
- if (myCurrentStatus != ARC_CHORD_END)
- return Standard_False;
- break;
- case XVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == X_FIXED)
- return Standard_False;
- break;
- case YVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == Y_FIXED)
- return Standard_False;
- break;
- }
- return Standard_True;
-}
-
-/*!
- Set a parameter value.
-
- \param atype
- \param aValue
-*/
-void Sketch::SetParameterValue(const TypeOfParameter atype, Standard_Real aValue)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- SetSegmentAngle(aValue);
- break;
- case LENGTH_PARAMETER:
- SetDimension(aValue);
- break;
- case RADIUS_PARAMETER:
- SetDimension(aValue);
- break;
- case XVALUE_PARAMETER:
- SetXDimension(aValue);
- break;
- case YVALUE_PARAMETER:
- SetYDimension(aValue);
- break;
- }
-}
-
-/*!
- Initialisation of sketch parameters or options.
-*/
-void Sketch::Init()
-{
- myPlane = new Geom_Plane (0.,0.,1.,0.);
- CreateConstraints();
- BRepLib::Plane(myPlane);
- myEdgesNumber = 0;
- myCurrentStatus = BEGIN_SKETCH;
- /* In order to update the visulisation of current objects by using Redisplay method from InteractiveContext */
- myCurrentEdge = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- myPresentableEdge = new AIS_Shape(myCurrentEdge);
- myPresentableEdge->SetColor(myCurrentColor.Name());
- myInteractiveContext->Display(myPresentableEdge);
- myTransitionStatus = NOCONSTRAINT;
- /* Init for display objects */
- TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10.,0.,0.));
- myLengthDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myXDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Horizontal);
- myYDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Vertical);
- myRadiusDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myCenterCircle = new AIS_Shape(V1);
- myIsLengthDimensionVisible = Standard_False;
- myIsXDimensionVisible = Standard_False;
- myIsYDimensionVisible = Standard_False;
- myIsRadiusDimensionVisible = Standard_False;
-}
-
-/*!
- Build the current segment.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentSegment(Standard_Real X, Standard_Real Y)
-{
- if (myTransitionStatus == NOCONSTRAINT)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- else if (myTransitionStatus == X_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(mySegmentX,Y));
- else if (myTransitionStatus == Y_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(X,mySegmentY));
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Vec2d Vt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D1(last,p1,Vt);
- else
- C->D1(first,p1,Vt);
- gp_Lin2d aline(p1,Vt);
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(aline));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(perpen));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == ANGLE && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- Standard_Real dist = RealLast();
- gp_Pnt2d pt(X,Y),ptproj;
- for (Standard_Integer i =1; i<=aSol.NbSolutions(); i++) {
- Geom2dAPI_ProjectPointOnCurve proj(pt,new Geom2d_Line(aSol.ThisSolution(i)));
- if (pt.Distance(proj.Point(1)) < dist) {
- dist = pt.Distance(proj.Point(1));
- ptproj = proj.Point(1);
- }
- }
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),ptproj);
- }
- }
- else if (myTransitionStatus == LENGTH_FIXED && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- gp_Lin2d aline = gce_MakeLin2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aline,0.,mySegmentLength);
- }
- }
-}
-
-/*!
- Build the current arc.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentArc(Standard_Real X, Standard_Real Y)
-{
- gp_Circ2d CircSol;
- Standard_Boolean OK(Standard_False);
-
- if (myTransitionStatus == NOCONSTRAINT) {
- GccAna_Circ2d2TanOn aSol(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- /* Tangency with previous edge */
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))){
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Line)::DownCast(C)->Lin2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Circle)::DownCast(C)->Circ2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if(C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) {
- gp_Pnt2d pc;
- gp_Vec2d Vt;
- C->D1(last,pc,Vt);
- gp_Lin2d alin2d(pc,gp_Dir2d(Vt));
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(alin2d), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- }
- /* Tangency with the perpendicular to the previous edge */
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(perpen), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
-
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- if (OK){
- gp_Vec2d V1(p,gp_Pnt2d(X,Y));
- gp_Vec2d V2(p,gp_Pnt2d(myLastX,myLastY));
- if (V1.Angle(V2) > 0 )
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- }
- else {
- myCurrentStatus = ARC_CHORD;
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext();
- }
-
-}
-
-/*!
- Display the current edge under construction with it's dimension.
-*/
-void Sketch::DisplayCurrentEdge()
-{
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- /* Length dimension */
- TopoDS_Vertex V1 = TopExp::FirstVertex(TopoDS::Edge(myCurrentEdge));
- TopoDS_Vertex V2 = TopExp::LastVertex(TopoDS::Edge(myCurrentEdge));
- DisplayLengthDimension(V1,V2);
- /* Angular dimension */
- DisplayAngleDimension();
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
- else if (myCurrentStatus == ARC_CHORD_END )
- DisplayRadiusDimension();
- else {
- TopoDS_Vertex V1 = TopoDS::Vertex(myCurrentEdge);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
-
-}
-
-/*!
- Display the current length dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- Standard_Real length = p1.Distance(p2);
- if (length <= Precision::Confusion()) return;
- myLengthDimension->SetFirstShape(V1);
- myLengthDimension->SetSecondShape(V2);
- fitInResol(length);
- myLengthDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myLengthDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myIsLengthDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myLengthDimension))
- myInteractiveContext->Redisplay(myLengthDimension);
- else
- myInteractiveContext->Display(myLengthDimension);
- }
-}
-
-/*!
- Display the current X dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != X_FIXED) {
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
-
- gp_Lin aline(p1,myPlane->Pln().XAxis().Direction());
- GeomAPI_ProjectPointOnCurve proj(p2,new Geom_Line(aline));
-
- gp_Pnt pb = p1;
-
- if (proj.NbPoints() > 0) {
- Standard_Real length = p1.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myXDimension->SetFirstShape(V1);
- myXDimension->SetSecondShape(V2);
- fitInResol(length);
- myXDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myXDimension->SetText(TCollection_ExtendedString(strdup(S)));
- // myXDimension->SetPosition(proj.Point(1));
- pb.BaryCenter(5,proj.Point(1),5);
- myXDimension->SetPosition(pb);
- if (myIsXDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myXDimension))
- myInteractiveContext->Redisplay(myXDimension);
- else
- myInteractiveContext->Display(myXDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current Y dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != Y_FIXED) {
-
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- gp_Lin aline(p2 /*p1*/, myPlane->Pln().YAxis().Direction());
- gp_Pnt pb = p2 /*p1*/;
- GeomAPI_ProjectPointOnCurve proj(p1 /*p2*/,new Geom_Line(aline));
- if (proj.NbPoints() > 0) {
- Standard_Real length = /*p1*/ p2.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myYDimension->SetFirstShape(V1);
- myYDimension->SetSecondShape(V2);
- fitInResol(length);
- myYDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myYDimension->SetText(TCollection_ExtendedString(strdup(S)));
- pb.BaryCenter(5,proj.Point(1),5);
- myYDimension->SetPosition(pb);
- // myYDimension->SetPosition(p2);
- if (myIsYDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myYDimension))
- myInteractiveContext->Redisplay(myYDimension);
- else
- myInteractiveContext->Display(myYDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current angle dimension.
-*/
-void Sketch::DisplayAngleDimension()
-{
- if (!myIsAngleDimensionVisible)
- return;
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- Handle (Geom2d_Curve) CurrentCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)) && CurrentCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Standard_Real angle = Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d().Angle(Handle(Geom2d_Line)::DownCast(CurrentCurve)->Lin2d());
- gp_Pnt2d apos;
- if (0 <= angle && angle<= PI)
- angle = PI - angle;
- else
- angle = PI + angle;
- CurrentCurve->D0((First+Last)/5.,apos);
- gp_Pnt apos3d = ElCLib::To3d(myPlane->Pln().Position().Ax2(),apos);
- Standard_Real angtext = angle*180./PI;
- mySegmentAngle = angle;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- fitInResol(angtext);
-
- QString S;
- S.sprintf("%.1f",angtext);
- if (myInteractiveContext->IndexOfCurrentLocal() == 0) {
- myInteractiveContext->OpenLocalContext();
- myAngleDimension = new AIS_AngleDimension(myPreviousEdge,TopoDS::Edge(myCurrentEdge),myPlane,angle,
- TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Display(myAngleDimension);
- }
- else {
- myAngleDimension->SetSecondShape(myCurrentEdge);
- myAngleDimension->SetValue(angle);
- myAngleDimension->SetPosition(apos3d);
- myAngleDimension->SetText(TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Redisplay(myAngleDimension);
- }
- }
- }
-}
-
-/*!
- Display the current radius dimension.
-*/
-void Sketch::DisplayRadiusDimension()
-{
- if (! myIsRadiusDimensionVisible)
- return;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- Standard_Real First,Last;
- Handle (Geom_Circle) C = Handle (Geom_Circle)::DownCast(BRep_Tool::Curve(TopoDS::Edge(myCurrentEdge),First,Last));
- if (!C.IsNull()) {
- Standard_Real R = C->Radius();
- TopoDS_Shape V1 = BRepBuilderAPI_MakeVertex(C->Location());
- gp_Pnt MidlePoint ;
- C->D0((First+Last)/2.,MidlePoint);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(MidlePoint);
- myRadiusDimension->SetFirstShape(V1);
- myRadiusDimension->SetSecondShape(V2);
- myRadiusDimension->SetValue(R);
- fitInResol(R);
- QString S;
- S.sprintf("%.1f",R);
- myRadiusDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myInteractiveContext->IsDisplayed(myRadiusDimension))
- myInteractiveContext->Redisplay(myRadiusDimension);
- else
- myInteractiveContext->Display(myRadiusDimension);
- myCenterCircle->Set(V1);
- if (myInteractiveContext->IsDisplayed(myCenterCircle))
- myInteractiveContext->Redisplay(myCenterCircle);
- else
- myInteractiveContext->Display(myCenterCircle);
- }
-}
-
-/*!
- Remove last edge from the current wire.
-*/
-void Sketch::RemoveLastEdge()
-{
- if (myEdgesNumber == 0) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return;
- }
- else {
- BRepTools_WireExplorer Ex;
- BRepBuilderAPI_MakeWire MW;
- Standard_Integer index = 1;
- myCurrentEdge = myPreviousEdge;
- for (Ex.Init(myCurrentWire.Wire());Ex.More();Ex.Next()){
- if (index <= myEdgesNumber-1) {
- MW.Add(Ex.Current());
- myPreviousEdge = Ex.Current();
- index++;
- }
- }
- myCurrentWire = MW;
- myCurrentStatus = (SketchStatus)myConstructionMode(myEdgesNumber);
- myTransitionStatus = (TransitionStatus)myConstraintMode(myEdgesNumber);
- myEdgesNumber--;
- myConstructionMode.Remove(index);
- myConstraintMode.Remove(index);
- if (myEdgesNumber == 0)
- myPresentableWire->Set(myFirstPointSketch);
- else
- myPresentableWire->Set(myCurrentWire.Wire());
- myInteractiveContext->Redisplay(myPresentableWire);
- myInteractiveContext->CloseLocalContext();
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- }
-}
-
-/*!
- Create initial constraints.
-*/
-void Sketch::CreateConstraints()
-{
- Handle(Geom_Axis1Placement) xAxis = new Geom_Axis1Placement(myPlane->Pln().XAxis());
- Handle(Geom_Axis1Placement) yAxis = new Geom_Axis1Placement(myPlane->Pln().YAxis());
- myHAxis = new AIS_Axis(xAxis);
- myVAxis = new AIS_Axis(yAxis);
- myAngularAxis = myVAxis;
- myHAxis->SetColor(myAxisColor.Name());
- myVAxis->SetColor(myAxisColor.Name());
- myAngularAxis->SetColor(myAxisColor.Name());
-}
-
-/*!
- fitInResol.
-
- \param toFit
- \param minIsResol
-*/
-void Sketch::fitInResol(Standard_Real &toFit, Standard_Boolean minIsResol)
-{
- Standard_Real sign = (toFit < 0) ? -1. : +1.;
- Standard_Real value = toFit + sign * resol/2.0; /* why "+ resol/2.0" ? because if resol = 0.5, 3.3 is rounded to 3.5 */
- int nTimesResol = int(value/resol);
- if ((nTimesResol == 0) && (minIsResol)) nTimesResol = 1;
- toFit = nTimesResol*resol;
-}
-
-SketchStatus Sketch::GetCurrentStatus()
-{
- return myCurrentStatus;
-}
-
-Standard_Integer Sketch::GetmyEdgesNumber()
-{
- return myEdgesNumber;
-}
-
-
-
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Sketcher.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-#include "GEOM_SketcherStatus.h"
-
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <Geom_Plane.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
-#include <AIS_Axis.hxx>
-#include <TopoDS_Edge.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
-#include <AIS_AngleDimension.hxx>
-#include <Geom2d_Line.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TColgp_SequenceOfPnt2d.hxx>
-#include <gp_Vec2d.hxx>
-
-class Sketch
-{
-public:
- Sketch();
- ~Sketch();
- Sketch(const Handle(V3d_Viewer)& aViewer);
- Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor);
-
- static void fitInResol(Standard_Real &toFit,
- Standard_Boolean minIsResol = Standard_False);
-
- void MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView );
-
- void MakeCurrentEdge(const Standard_Real X, const Standard_Real Y);
-
- Standard_Boolean SetDimension(Standard_Real& aValue);
- void SetDimension(Standard_Real& deltaX,Standard_Real& deltaY);
-
- void SetXDimension(Standard_Real& deltaX);
- void SetYDimension(Standard_Real& deltaY);
-
- void SetSegmentAngle(Standard_Real& aValue);
- Standard_Real GetSegmentAngle();
-
- void ValidateEdge();
-
- TopoDS_Wire Close();
- TopoDS_Wire End();
-
- void Clear();
-
- Standard_Boolean Delete();
-
- void SetPlane(const Handle(Geom_Plane)& aPlane);
-
- void SetWireColor(const Quantity_Color& aColor);
- void SetCurrentColor(const Quantity_Color& aColor);
- void SetAxisColor(const Quantity_Color& aColor);
-
- void SetParameterVisibility(const TypeOfParameter atype,
- const Standard_Boolean OnOff);
-
- void HiligthWithColor(const TypeOfParameter atype,
- const Quantity_NameOfColor acolor);
- void Unhiligth(const TypeOfParameter atype);
-
- Standard_Boolean IsValidCurrentParameter(const TypeOfParameter atype);
-
- void SetParameterValue(const TypeOfParameter atype, Standard_Real aValue);
-
- void ChangeMode(const SketchStatus aMode);
-
- void SetTransitionStatus(const TransitionStatus aStatus);
-
- SketchStatus GetCurrentStatus();
- Standard_Integer GetmyEdgesNumber();
-
-private :
-
- void Init();
-
- void MakeCurrentSegment(Standard_Real X, Standard_Real Y);
-
- void MakeCurrentArc(Standard_Real X, Standard_Real Y);
-
- void DisplayCurrentEdge();
-
- void DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayAngleDimension();
- void DisplayRadiusDimension();
-
- void AddEdgeToWire();
-
- void RemoveLastEdge();
-
- void CreateConstraints();
-
-private:
- // Current status of construction
- SketchStatus myCurrentStatus;
- // Transition status between arcs and segments
- TransitionStatus myTransitionStatus;
- // Current wire
- BRepBuilderAPI_MakeWire myCurrentWire;
- // Current presentable wire
- Handle_AIS_Shape myPresentableWire;
- // Number of edges into the current wire
- Standard_Integer myEdgesNumber;
- // Store for each edge how it has been built i.d the value of myCurrentStatus
- TColStd_SequenceOfInteger myConstructionMode;
- // Store for each edge how it has been built i.d the value of myTransitionStatus
- TColStd_SequenceOfInteger myConstraintMode;
- // Current edge
- TopoDS_Shape myCurrentEdge;
- // Previous edge
- TopoDS_Edge myPreviousEdge;
- // List of points to interpolate when computing a curve by interpolation
- TColgp_SequenceOfPnt2d myPointsToInterpolate;
- // Tangent vector at beginning of curve
- gp_Vec2d myTangentVector;
- // Tangent flag at beginning og curve
- Standard_Boolean myTangentFlag;
-
- // Origin of sketch
- TopoDS_Vertex myFirstPointSketch;
- // Last x coordinate of end point of previous edge or picked point
- Standard_Real myLastX;
- // Last y coordinate of end point of previous edge or picked point
- Standard_Real myLastY;
- // angle between 2 segments when an ANGLE TransitionStatus is set.
- Standard_Real mySegmentAngle;
- // Length of segment when the length of the segment is fixed before the angle
- Standard_Real mySegmentLength;
- // Value of X fixed coordinate
- Standard_Real mySegmentX;
- // Value of Y fixed Coordinate
- Standard_Real mySegmentY;
- Handle_AIS_Shape myPresentableEdge; // Current presentable edge
- Handle_AIS_LengthDimension myLengthDimension;// For display of current length segment dimension
- Handle_AIS_LengthDimension myXDimension; // For display of current X segment dimension
- Handle_AIS_LengthDimension myYDimension; // For display of current Y segment dimension
- Handle_AIS_LengthDimension myRadiusDimension;// For display of current radius dimension
- Handle_AIS_AngleDimension myAngleDimension; // For display of current angle dimension
- Standard_Boolean myIsLengthDimensionVisible; // Visibility flag for LengthDimension
- Standard_Boolean myIsXDimensionVisible; // Visibility flag for X Dimension
- Standard_Boolean myIsYDimensionVisible; // Visibility flag for Y Dimension
- Standard_Boolean myIsRadiusDimensionVisible; // Visibility flag for RadiusDimension
- Standard_Boolean myIsAngleDimensionVisible; // Visibility flag for AngleDimension
- Handle_AIS_Axis myPresentableMediatrice; // Chord mediatrice of current circle as a presentable object
- Handle_Geom2d_Line myMediatrice; // Chord mediatrice of current circle as a 2d line
- Handle_AIS_Shape myCenterCircle; // to visualise center of current arc
-
- Handle_AIS_Axis myHAxis; // Horizontal axis
- Handle_AIS_Axis myVAxis; // Vertical axis
- Handle_AIS_Axis myAngularAxis; // Axis making a predefined angle with the previous edge
-
- Quantity_Color myWireColor; // Color of wire and of build edges
- Quantity_Color myCurrentColor; // Color of edge under construction
- Quantity_Color myAxisColor; // Color for axis
- Handle_AIS_InteractiveContext myInteractiveContext; // Interactive context for display management
-
- Handle_Geom_Plane myPlane; // Plane of sketch
-
- BRepBuilderAPI_MakeWire myPasteWire;
- Standard_Integer myPasteEdgesNumber;
- TColStd_SequenceOfInteger myPasteConstructionMode;
- TColStd_SequenceOfInteger myPasteConstraintMode;
-};
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_SketcherStatus.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-enum TransitionStatus {
- NOCONSTRAINT, // no constraint between consecutive edges
- TANGENT, // arc and segment are tangent
- PERPENDICULAR,// arc is tangent to the perpendicular to the segment
- ANGLE, // Angular constraint between 2 segments
- LENGTH_FIXED, // Length of segment has been fixed
- X_FIXED, // X coordinate for segment has been fixed
- Y_FIXED // Y coordinate for segment has been fixed
- };
-
-enum TypeOfParameter {
- ANGLE_PARAMETER,
- LENGTH_PARAMETER,
- RADIUS_PARAMETER,
- XVALUE_PARAMETER,
- YVALUE_PARAMETER
- };
-
-enum SketchStatus {
- BEGIN_SKETCH, // Begin sketch; no edges created yet
- SEGMENT, // Current mode for creation is segment
- ARC_CHORD, // Current mode for creation is arc by chord
- ARC_CHORD_END,// Chord validated, waiting for radius or center
- END_SKETCH // End sketch
-};
-# GEOM SKETCHER : basic sketcher
+# GEOM GEOMBASE :
#
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
#
# File : Makefile.in
-# Author : Patrick GOLDBRONN (CEA)
+# Author : Damien COQUERET (OCC)
# Module : GEOM
-# $Header$
+# $Header:
top_srcdir=@top_srcdir@
top_builddir=../..
# Libraries targets
LIB = libGEOMSketcher.la
-LIB_SRC = GEOM_Sketcher.cxx
-LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
+LIB_SRC = Sketcher_Profile.cxx
+LIB_CLIENT_IDL = SALOME_Exception.idl \
+ SALOMEDS.idl \
+ SALOMEDS_Attributes.idl
# header files
-EXPORT_HEADERS= GEOM_Sketcher.h \
- GEOM_SketcherStatus.h
+EXPORT_HEADERS = Sketcher_Profile.hxx
# additionnal information to compil and link file
-CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
+CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-# additional file to be cleaned
-MOSTLYCLEAN =
-CLEAN =
-DISTCLEAN =
+LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
@CONCLUDE@
-
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : Sketcher_Profile.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "Sketcher_Profile.hxx"
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Ax2.hxx>
+#include <BRepLib.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <Geom2d_Line.hxx>
+#include <Geom2d_Circle.hxx>
+#include <Geom_Surface.hxx>
+#include <Precision.hxx>
+#include <GeomAPI.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile()
+{
+}
+
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile(const char* aCmd)
+{
+ enum {line, circle, point, none} move;
+
+ Standard_Integer i = 1;
+ Standard_Real x0, y0, x, y, dx, dy;
+ x0 = y0 = x = y = dy = 0;
+ dx = 1;
+
+ Standard_Boolean first, stayfirst, face, close;
+ first = Standard_True;
+ stayfirst = face = close = Standard_False;
+
+ TopoDS_Shape S;
+ TopoDS_Vertex MP;
+ BRepBuilderAPI_MakeWire MW;
+ gp_Ax3 DummyHP(gp::XOY());
+ gp_Pln P(DummyHP);
+ TopLoc_Location TheLocation;
+ Handle(Geom_Surface) Surface;
+
+ myOK = Standard_False;
+
+ TCollection_AsciiString aCommand(CORBA::string_dup(aCmd));
+ TCollection_AsciiString aToken = aCommand.Token(":", 1);
+ int n = 0;
+ TCollection_AsciiString aTab[aCommand.Length()];
+ while(aToken.Length() != 0) {
+ if(aCommand.Token(":", n + 1).Length() > 0)
+ aTab[n] = aCommand.Token(":", n + 1);
+ aToken = aCommand.Token(":", ++n);
+ }
+ n = n - 1;
+
+ while(i < n) {
+ Standard_Real length = 0, radius = 0, angle = 0;
+ move = point;
+
+ int n1 = 0;
+ TCollection_AsciiString a[aTab[0].Length()];
+ aToken = aTab[i].Token(" ", 1);
+ while(aToken.Length() != 0) {
+ if(aTab[i].Token(" ", n1 + 1).Length() > 0)
+ a[n1] = aTab[i].Token(" ", n1 + 1);
+ aToken = aTab[i].Token(" ", ++n1);
+ }
+ n1 = n1 - 1;
+
+ switch(a[0].Value(1))
+ {
+ case 'F':
+ {
+ if (n1 != 3) goto badargs;
+ if (!first) {
+ cout<<"profile : The F instruction must precede all moves"<<endl;
+ return;
+ }
+ x0 = x = a[1].RealValue();
+ y0 = y = a[2].RealValue();
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'O':
+ {
+ if (n1 != 4) goto badargs;
+ P.SetLocation(gp_Pnt(a[1].RealValue(), a[2].RealValue(), a[3].RealValue()));
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'P':
+ {
+ if (n1 != 7) goto badargs;
+ gp_Vec vn(a[1].RealValue(), a[2].RealValue(), a[3].RealValue());
+ gp_Vec vx(a[4].RealValue(), a[5].RealValue(), a[6].RealValue());
+ if (vn.Magnitude() <= Precision::Confusion() || vx.Magnitude() <= Precision::Confusion()) {
+ cout<<"profile : null direction"<<endl;
+ return;
+ }
+ gp_Ax2 ax(P.Location(), vn, vx);
+ P.SetPosition(ax);
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'X':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "XX")
+ length -= x;
+ dx = 1; dy = 0;
+ move = line;
+ break;
+ }
+ case 'Y':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "YY")
+ length -= y;
+ dx = 0; dy = 1;
+ move = line;
+ break;
+ }
+ case 'L':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'T':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ if (a[0] == "TT") {
+ vx -= x;
+ vy -= y;
+ }
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ move = line;
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'R':
+ {
+ if (n1 != 2) goto badargs;
+ angle = a[1].RealValue() * PI180;
+ if (a[0] == "RR") {
+ dx = Cos(angle);
+ dy = Sin(angle);
+ }
+ else {
+ Standard_Real c = Cos(angle);
+ Standard_Real s = Sin(angle);
+ Standard_Real t = c * dx - s * dy;
+ dy = s * dx + c * dy;
+ dx = t;
+ }
+ break;
+ }
+ case 'D':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'C':
+ {
+ if (n1 != 3) goto badargs;
+ radius = a[1].RealValue();
+ if (Abs(radius) > Precision::Confusion()) {
+ angle = a[2].RealValue() * PI180;
+ move = circle;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'I':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "IX") {
+ if (Abs(dx) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - x) / dx;
+ }
+ else if (a[0] == "IY") {
+ if (Abs(dy) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - y) / dy;
+ }
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'W':
+ {
+ if (a[0] == "WW")
+ close = Standard_True;
+ else if(a[0] == "WF") {
+ close = Standard_True;
+ face = Standard_True;
+ }
+ i = n - 1;
+ break;
+ }
+ default:
+ {
+ cout<<"profile : unknown code "<<a[i]<<endl;
+ return;
+ }
+ }
+
+ again :
+ switch (move)
+ {
+ case line :
+ {
+ if (length < 0) {
+ length = -length;
+ dx = -dx;
+ dy = -dy;
+ }
+ Handle(Geom2d_Line) l = new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
+ x += length*dx;
+ y += length*dy;
+ break;
+ }
+ case circle :
+ {
+ Standard_Boolean sense = Standard_True;
+ if (radius < 0) {
+ radius = -radius;
+ sense = !sense;
+ dx = -dx;
+ dy = -dy;
+ }
+ gp_Ax2d ax(gp_Pnt2d(x-radius*dy,y+radius*dx),gp_Dir2d(dy,-dx));
+ if (angle < 0) {
+ angle = -angle;
+ sense = !sense;
+ }
+ Handle(Geom2d_Circle) c = new Geom2d_Circle(ax,radius,sense);
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(c,P),0,angle));
+ gp_Pnt2d p;
+ gp_Vec2d v;
+ c->D1(angle,p,v);
+ x = p.X();
+ y = p.Y();
+ dx = v.X() / radius;
+ dy = v.Y() / radius;
+ break;
+ }
+ case point:
+ {
+ MP = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, 0.0));
+ break;
+ }
+ case none:
+ {
+ i = n - 1;
+ break;
+ }
+ }
+
+ // update first
+ first = stayfirst;
+ stayfirst = Standard_False;
+
+ if(!(dx == 0 && dy == 0))
+ myLastDir.SetCoord(dx, dy, 0.0);
+ else
+ return;
+ myLastPoint.SetX(x);
+ myLastPoint.SetY(y);
+
+ // next segment....
+ i++;
+ if ((i == n) && close) {
+ // the closing segment
+ dx = x0 - x;
+ dy = y0 - y;
+ length = Sqrt(dx * dx + dy * dy);
+ if (length > Precision::Confusion()) {
+ move = line;
+ dx = dx / length;
+ dy = dy / length;
+ goto again;
+ }
+ }
+ }
+
+ // get the result, face or wire
+ if (move == none)
+ return;
+ else if (move == point)
+ S = MP;
+ else if (face)
+ S = BRepBuilderAPI_MakeFace(P, MW.Wire());
+ else
+ S = MW;
+
+ if(!TheLocation.IsIdentity())
+ S.Move(TheLocation);
+
+ myShape = S;
+ myOK = true;
+ return;
+
+ badargs :
+ cout<<"profile : bad number of arguments"<<endl;
+ return;
+}
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : Sketcher_Profile.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <TopoDS_Shape.hxx>
+
+class Sketcher_Profile
+{
+
+public:
+ Sketcher_Profile();
+ Sketcher_Profile(const char* aCmd);
+
+private:
+ gp_Pnt myLastPoint;
+ gp_Dir myLastDir;
+
+ TopoDS_Shape myShape;
+ bool myOK;
+
+public:
+ gp_Pnt GetLastPoint(){return myLastPoint;};
+ gp_Dir GetLastDir(){return myLastDir;};
+
+ const TopoDS_Shape& GetShape(){return myShape;};
+ bool IsDone(){return myOK;};
+
+};