DCQ : New Architecture
@ -229,6 +229,7 @@ module GEOM
|
||||
in double WaterDensity,
|
||||
in double MeshingDeflection) raises (SALOME::SALOME_Exception);
|
||||
|
||||
|
||||
//-----------------------------------------------------------//
|
||||
// Build //
|
||||
//-----------------------------------------------------------//
|
||||
@ -238,6 +239,8 @@ module GEOM
|
||||
GEOM_Shape MakeCompound (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
|
||||
GEOM_Shape MakeFace (in GEOM_Shape shapeWire,
|
||||
in boolean wantplanarface ) raises (SALOME::SALOME_Exception) ;
|
||||
GEOM_Shape MakeShell (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
|
||||
GEOM_Shape MakeSolid (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
|
||||
|
||||
|
||||
//-----------------------------------------------------------//
|
||||
|
@ -41,28 +41,28 @@
|
||||
|
||||
|
||||
<!-- ************************* New Entity (menubar) ******************************* -->
|
||||
<menu-item label-id="New Entity" item-id="70" pos-id="3">
|
||||
<submenu label-id="Basic" item-id="301" pos-id="1">
|
||||
<popup-item item-id="3011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3012" pos-id="" label-id="Line" icon-id="line.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3013" pos-id="" label-id="Circle" icon-id="circle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<menu-item label-id="New Entity" item-id="40" pos-id="3">
|
||||
<submenu label-id="Basic" item-id="401" pos-id="1">
|
||||
<popup-item item-id="4011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4012" pos-id="" label-id="Line" icon-id="line.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4013" pos-id="" label-id="Circle" icon-id="circle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id="6"/>
|
||||
<popup-item item-id="3016" pos-id="" label-id="Vector" icon-id="vector.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3017" pos-id="" label-id="Plane" icon-id="plane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3018" pos-id="" label-id="Working Plane" icon-id="planeWorking.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4016" pos-id="" label-id="Vector" icon-id="vector.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4017" pos-id="" label-id="Plane" icon-id="plane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4018" pos-id="" label-id="Working Plane" icon-id="planeWorking.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<submenu label-id="Primitives" item-id="302" pos-id="2">
|
||||
<popup-item item-id="3021" pos-id="" label-id="Box" icon-id="box.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3022" pos-id="" label-id="Cylinder" icon-id="cylinder.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3023" pos-id="" label-id="Sphere" icon-id="sphere.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3024" pos-id="" label-id="Torus" icon-id="torus.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3025" pos-id="" label-id="Cone" icon-id="cone.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Primitives" item-id="402" pos-id="2">
|
||||
<popup-item item-id="4021" pos-id="" label-id="Box" icon-id="box.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4022" pos-id="" label-id="Cylinder" icon-id="cylinder.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4023" pos-id="" label-id="Sphere" icon-id="sphere.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4024" pos-id="" label-id="Torus" icon-id="torus.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4025" pos-id="" label-id="Cone" icon-id="cone.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<submenu label-id="Generation" item-id="310" pos-id="3">
|
||||
<submenu label-id="Generation" item-id="403" pos-id="3">
|
||||
<popup-item item-id="4031" pos-id="" label-id="Extrusion" icon-id="prism.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4032" pos-id="" label-id="Revolution" icon-id="revol.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4033" pos-id="" label-id="Filling" icon-id="filling.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
@ -70,104 +70,106 @@
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="312" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Sketch Constraints" item-id="313" pos-id="">
|
||||
<popup-item item-id="3131" pos-id="" label-id="Set Plane" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="404" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Sketch Constraints" item-id="405" pos-id="">
|
||||
<popup-item item-id="4051" pos-id="" label-id="Set Plane" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="3133" pos-id="" label-id="Tangent" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="3134" pos-id="" label-id="Perpendicular" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4052" pos-id="" label-id="Tangent" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4053" pos-id="" label-id="Perpendicular" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<submenu label-id="Sketch Options" item-id="10009" pos-id="">
|
||||
<popup-item item-id="10010" pos-id="" label-id="Length Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="10011" pos-id="" label-id="Angle Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="10012" pos-id="" label-id="Radius Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="10013" pos-id="" label-id="X Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
||||
<popup-item item-id="10014" pos-id="" label-id="Y Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
||||
<submenu label-id="Sketch Options" item-id="406" pos-id="">
|
||||
<popup-item item-id="4061" pos-id="" label-id="Length Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="4062" pos-id="" label-id="Angle Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="4063" pos-id="" label-id="Radius Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="4064" pos-id="" label-id="X Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
||||
<popup-item item-id="4065" pos-id="" label-id="Y Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="303" pos-id="" label-id="Explode" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="309" pos-id="" label-id="Suppress faces" icon-id="supressface.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="314" pos-id="" label-id="Suppress hole" icon-id="supresshole.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Build" item-id="311" pos-id="">
|
||||
<popup-item item-id="304" pos-id="" label-id="Edge" icon-id="build_edge.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="305" pos-id="" label-id="Wire" icon-id="build_wire.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="306" pos-id="" label-id="Face" icon-id="build_face.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="308" pos-id="" label-id="Compound" icon-id="build_compound.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="407" pos-id="" label-id="Explode" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Build" item-id="408" pos-id="">
|
||||
<popup-item item-id="4081" pos-id="" label-id="Edge" icon-id="build_edge.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4082" pos-id="" label-id="Wire" icon-id="build_wire.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4083" pos-id="" label-id="Face" icon-id="build_face.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4084" pos-id="" label-id="Shell" icon-id="build_shell.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4085" pos-id="" label-id="Solid" icon-id="build_solid.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4086" pos-id="" label-id="Compound" icon-id="build_compound.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
</menu-item>
|
||||
|
||||
|
||||
<!-- ************************ Operations (menubar) *********************************** -->
|
||||
<menu-item label-id="Operations" item-id="40" pos-id="4">
|
||||
<submenu label-id="Boolean" item-id="401" pos-id="1">
|
||||
<popup-item item-id="4011" pos-id="" label-id="Fuse" icon-id="fuse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4012" pos-id="" label-id="Common" icon-id="common.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4013" pos-id="" label-id="Cut" icon-id="cut.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4014" pos-id="" label-id="Section" icon-id="section.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<menu-item label-id="Operations" item-id="50" pos-id="4">
|
||||
<submenu label-id="Boolean" item-id="501" pos-id="1">
|
||||
<popup-item item-id="5011" pos-id="" label-id="Fuse" icon-id="fuse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5012" pos-id="" label-id="Common" icon-id="common.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5013" pos-id="" label-id="Cut" icon-id="cut.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5014" pos-id="" label-id="Section" icon-id="section.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<submenu label-id="Transformation" item-id="402" pos-id="2">
|
||||
<popup-item item-id="4021" pos-id="" label-id="Translation" icon-id="translation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4022" pos-id="" label-id="Rotation" icon-id="rotate.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4023" pos-id="" label-id="Mirror by plane" icon-id="mirrorPlane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4024" pos-id="" label-id="Scale transform" icon-id="scale.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Transformation" item-id="502" pos-id="2">
|
||||
<popup-item item-id="5021" pos-id="" label-id="Translation" icon-id="translation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5022" pos-id="" label-id="Rotation" icon-id="rotate.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5023" pos-id="" label-id="Mirror by plane" icon-id="mirrorPlane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5024" pos-id="" label-id="Scale transform" icon-id="scale.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="4030" pos-id="" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4040" pos-id="" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5025" pos-id="" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5026" pos-id="" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<popup-item item-id="4025" pos-id="" label-id="Partition" icon-id="partition.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4026" pos-id="" label-id="Archimede" icon-id="archimede.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="503" pos-id="" label-id="Partition" icon-id="partition.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="504" pos-id="" label-id="Archimede" icon-id="archimede.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="4027" pos-id="" label-id="Fillet" icon-id="fillet.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4028" pos-id="" label-id="Chamfer" icon-id="chamfer.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="505" pos-id="" label-id="Fillet" icon-id="fillet.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="506" pos-id="" label-id="Chamfer" icon-id="chamfer.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</menu-item>
|
||||
|
||||
|
||||
<!-- ************************** Advanced (menubar) ************************************** -->
|
||||
<menu-item label-id="Repair" item-id="50" pos-id="5">
|
||||
<popup-item item-id="501" pos-id="" label-id="Sewing" icon-id="sewing.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="502" pos-id="" label-id="Orientation" icon-id="orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<menu-item label-id="Repair" item-id="60" pos-id="5">
|
||||
<popup-item item-id="601" pos-id="" label-id="Sewing" icon-id="sewing.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="602" pos-id="" label-id="Orientation" icon-id="orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="603" pos-id="" label-id="Suppress faces" icon-id="supressface.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="604" pos-id="" label-id="Suppress hole" icon-id="supresshole.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</menu-item>
|
||||
|
||||
|
||||
<!-- ************************** Mesures (menubar) ************************************ -->
|
||||
<menu-item label-id="Measures" item-id="60" pos-id="6">
|
||||
<popup-item item-id="601" pos-id="" label-id="Basic properties" icon-id="basicproperties.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<menu-item label-id="Measures" item-id="70" pos-id="6">
|
||||
<popup-item item-id="701" pos-id="" label-id="Basic properties" icon-id="basicproperties.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id="4"/>
|
||||
<popup-item item-id="604" pos-id="" label-id="Center of gravity" icon-id="centergravity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="605" pos-id="" label-id="Axis of inertia" icon-id="axisinertia.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="702" pos-id="" label-id="Center of gravity" icon-id="centergravity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="703" pos-id="" label-id="Axis of inertia" icon-id="axisinertia.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id="7"/>
|
||||
<submenu label-id="Dimensions" item-id="606" pos-id="8">
|
||||
<popup-item item-id="6060" pos-id="" label-id="Bounding Box" icon-id="bounding.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="6061" pos-id="" label-id="Min distance" icon-id="mindist.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Dimensions" item-id="704" pos-id="8">
|
||||
<popup-item item-id="7041" pos-id="" label-id="Bounding Box" icon-id="bounding.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="7042" pos-id="" label-id="Min distance" icon-id="mindist.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<separator pos-id="9"/>
|
||||
<popup-item item-id="607" pos-id="" label-id="Tolerance" icon-id="tolerance.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="705" pos-id="" label-id="Tolerance" icon-id="tolerance.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="608" pos-id="" label-id="Whatis" icon-id="whatis.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="609" pos-id="" label-id="Check" icon-id="check.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="706" pos-id="" label-id="Whatis" icon-id="whatis.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="707" pos-id="" label-id="Check" icon-id="check.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</menu-item>
|
||||
|
||||
<!-- ********************************* Tools (menubar) ************************************ -->
|
||||
<menu-item label-id="Tools" item-id="5" pos-id="">
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="5001" pos-id="" label-id="Check Geometry" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5103" pos-id="" label-id="Check Geometry" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="5104" pos-id="" label-id="Load Script" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</menu-item>
|
||||
|
||||
<!-- ********************************* Settings (menubar) ********************************* -->
|
||||
<menu-item label-id="Preferences" item-id="4" pos-id="">
|
||||
<submenu label-id="Geometry" item-id="40" pos-id="-1">
|
||||
<popup-item item-id="701" pos-id="" label-id="Automatic copy" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="702" pos-id="" label-id="Name/Store automatic" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<submenu label-id="Geometry" item-id="41" pos-id="-1">
|
||||
<popup-item item-id="411" pos-id="" label-id="Name/Store automatic" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="703" pos-id="" label-id="Shading Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="704" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="705" pos-id="" label-id="Step value" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="412" pos-id="" label-id="Shading Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="413" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="414" pos-id="" label-id="Step value" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<separator pos-id="-1"/>
|
||||
@ -176,12 +178,12 @@
|
||||
<!-- ***************************** View (menubar) ************************************ -->
|
||||
<menu-item label-id="View" item-id="2" pos-id="">
|
||||
<submenu label-id="Display mode" item-id="21" pos-id="5">
|
||||
<popup-item item-id="6021" pos-id="" label-id="Shading" icon-id="shading.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="211" pos-id="" label-id="Shading" icon-id="shading.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="6022" pos-id="" label-id="Display all" icon-id="displayall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="6023" pos-id="" label-id="Display only" icon-id="display.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="6024" pos-id="" label-id="Erase all" icon-id="eraseall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="6025" pos-id="" label-id="Erase only" icon-id="erase.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="212" pos-id="" label-id="Display all" icon-id="displayall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="213" pos-id="" label-id="Display only" icon-id="display.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="214" pos-id="" label-id="Erase all" icon-id="eraseall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="215" pos-id="" label-id="Erase only" icon-id="erase.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
</menu-item>
|
||||
@ -192,29 +194,29 @@
|
||||
|
||||
<!-- ///////////////////////////////////// TOOLBARS ////////////////////////////////////// -->
|
||||
<toolbar label-id="Basic">
|
||||
<toolbutton-item item-id="3011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="Point" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3012" pos-id="" label-id="Line" icon-id="line.png" tooltip-id="Line" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3013" pos-id="" label-id="Circle" icon-id="circle.png" tooltip-id="Circle" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="Ellipse" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="Arc" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3016" pos-id="" label-id="Vector" icon-id="vector.png" tooltip-id="Vector" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3017" pos-id="" label-id="Plane" icon-id="plane.png" tooltip-id="Plane" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3018" pos-id="" label-id="Working Plane" icon-id="planeWorking.png" tooltip-id="Working Plane" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="Point" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4012" pos-id="" label-id="Line" icon-id="line.png" tooltip-id="Line" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4013" pos-id="" label-id="Circle" icon-id="circle.png" tooltip-id="Circle" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="Ellipse" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="Arc" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4016" pos-id="" label-id="Vector" icon-id="vector.png" tooltip-id="Vector" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4017" pos-id="" label-id="Plane" icon-id="plane.png" tooltip-id="Plane" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4018" pos-id="" label-id="Working Plane" icon-id="planeWorking.png" tooltip-id="Working Plane" accel-id="" toggle-id="" execute-action=""/>
|
||||
</toolbar>
|
||||
|
||||
<toolbar label-id="Primitives">
|
||||
<toolbutton-item item-id="3021" label-id="Box" icon-id="box.png" tooltip-id="Box" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3022" label-id="Cylinder" icon-id="cylinder.png" tooltip-id="Cylinder" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3023" label-id="Sphere" icon-id="sphere.png" tooltip-id="Sphere" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3024" label-id="Torus" icon-id="torus.png" tooltip-id="Torus" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="3025" label-id="Cone" icon-id="cone.png" tooltip-id="Cone" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4021" label-id="Box" icon-id="box.png" tooltip-id="Box" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4022" label-id="Cylinder" icon-id="cylinder.png" tooltip-id="Cylinder" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4023" label-id="Sphere" icon-id="sphere.png" tooltip-id="Sphere" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4024" label-id="Torus" icon-id="torus.png" tooltip-id="Torus" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4025" label-id="Cone" icon-id="cone.png" tooltip-id="Cone" accel-id="" toggle-id="" execute-action=""/>
|
||||
</toolbar>
|
||||
|
||||
<toolbar label-id="Ope. Boolean">
|
||||
<toolbutton-item item-id="4011" label-id="Fuse" icon-id="fuse.png" tooltip-id="Fuse two shapes" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4012" label-id="Common" icon-id="common.png" tooltip-id="Common of two shapes" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4013" label-id="Cut" icon-id="cut.png" tooltip-id="Cut first shape with second" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4014" label-id="Section" icon-id="section.png" tooltip-id="Section lines of intersection (2 shapes)" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5011" label-id="Fuse" icon-id="fuse.png" tooltip-id="Fuse two shapes" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5012" label-id="Common" icon-id="common.png" tooltip-id="Common of two shapes" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5013" label-id="Cut" icon-id="cut.png" tooltip-id="Cut first shape with second" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5014" label-id="Section" icon-id="section.png" tooltip-id="Section lines of intersection (2 shapes)" accel-id="" toggle-id="" execute-action=""/>
|
||||
</toolbar>
|
||||
|
||||
<toolbar label-id="Generation">
|
||||
@ -225,28 +227,28 @@
|
||||
</toolbar>
|
||||
|
||||
<toolbar label-id="Transformation">
|
||||
<toolbutton-item item-id="4021" label-id="Translation" icon-id="translation.png" tooltip-id="Translate a shape"accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4022" label-id="Rotation" icon-id="rotate.png" tooltip-id="Rotate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4023" label-id="Mirror by plane" icon-id="mirrorPlane.png" tooltip-id="Mirror a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4024" label-id="Scale transform" icon-id="scale.png" tooltip-id="Scale a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5021" label-id="Translation" icon-id="translation.png" tooltip-id="Translate a shape"accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5022" label-id="Rotation" icon-id="rotate.png" tooltip-id="Rotate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5023" label-id="Mirror by plane" icon-id="mirrorPlane.png" tooltip-id="Mirror a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5024" label-id="Scale transform" icon-id="scale.png" tooltip-id="Scale a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separatorTB/>
|
||||
<toolbutton-item item-id="4030" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="Multi-translate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="4040" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="Multi-rotate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5025" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="Multi-translate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
<toolbutton-item item-id="5026" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="Multi-rotate a shape" accel-id="" toggle-id="" execute-action=""/>
|
||||
</toolbar>
|
||||
|
||||
|
||||
<!-- ################################# POPUP MENU ################################# -->
|
||||
<popupmenu label-id="Popup for Viewer" context-id="" parent-id="Viewer" object-id="">
|
||||
<submenu label-id="Properties" item-id="803" pos-id="6">
|
||||
<popup-item item-id="8021" pos-id="" label-id="Wireframe - Shading" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8031" pos-id="" label-id="Wireframe - Shading" icon-id="" tooltip-id="" accel-id="Ctrl+D" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="8031" pos-id="" label-id="Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8032" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8033" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8032" pos-id="" label-id="Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8033" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="8034" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</submenu>
|
||||
<endsubmenu />
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="801" pos-id="" label-id="Add in study" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="804" pos-id="" label-id="Add in study" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</popupmenu>
|
||||
|
||||
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="">
|
||||
@ -256,17 +258,17 @@
|
||||
</popupmenu>
|
||||
|
||||
<popupmenu label-id="Sketch" context-id="Sketch" parent-id="Viewer" object-id="">
|
||||
<popup-item item-id="10000" pos-id="" label-id="Segment" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="10001" pos-id="" label-id="Arc" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4041" pos-id="" label-id="Segment" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
||||
<popup-item item-id="4042" pos-id="" label-id="Arc" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="10002" pos-id="" label-id="Set Angle" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="10003" pos-id="" label-id="Set X" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="10004" pos-id="" label-id="Set Y" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4043" pos-id="" label-id="Set Angle" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4044" pos-id="" label-id="Set X" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4045" pos-id="" label-id="Set Y" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="10006" pos-id="" label-id="Undo" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4046" pos-id="" label-id="Undo" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<separator pos-id=""/>
|
||||
<popup-item item-id="10007" pos-id="" label-id="End" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="10008" pos-id="" label-id="Close" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4047" pos-id="" label-id="End" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
<popup-item item-id="4048" pos-id="" label-id="Close" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||
</popupmenu>
|
||||
|
||||
</desktop> <!-- DESKTOP END -->
|
||||
|
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 908 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 363 B |
445
src/BasicGUI/BasicGUI.cxx
Normal file
@ -0,0 +1,445 @@
|
||||
// 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 : BasicGUI.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "QAD_RightFrame.h"
|
||||
#include "OCCViewer_Viewer3d.h"
|
||||
#include "OCCViewer_ViewPort3d.h"
|
||||
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
|
||||
#include "BasicGUI_PointDlg.h" // Method POINT
|
||||
#include "BasicGUI_LineDlg.h" // Method LINE
|
||||
#include "BasicGUI_CircleDlg.h" // Method CIRCLE
|
||||
#include "BasicGUI_EllipseDlg.h" // Method ELLIPSE
|
||||
#include "BasicGUI_ArcDlg.h" // Method ARC
|
||||
#include "BasicGUI_VectorDlg.h" // Method VECTOR
|
||||
#include "BasicGUI_PlaneDlg.h" // Method PLANE
|
||||
#include "BasicGUI_WorkingPlaneDlg.h" // Method WORKING PLANE
|
||||
|
||||
//=======================================================================
|
||||
// function : BasicGUI()
|
||||
// purpose : Constructor
|
||||
//=======================================================================
|
||||
BasicGUI::BasicGUI() :
|
||||
QObject()
|
||||
{
|
||||
myGeomBase = new GEOMBase();
|
||||
myGeomGUI = GEOMContext::GetGeomGUI();
|
||||
myGeom = myGeomGUI->myComponentGeom;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ~BasicGUI()
|
||||
// purpose : Destructor
|
||||
//=======================================================================
|
||||
BasicGUI::~BasicGUI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : OnGUIEvent()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
bool BasicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{
|
||||
BasicGUI* myBasicGUI = new BasicGUI();
|
||||
myBasicGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||
|
||||
switch (theCommandID)
|
||||
{
|
||||
case 4011: // POINT
|
||||
{
|
||||
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();
|
||||
}
|
||||
BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", myBasicGUI, Sel, ic);
|
||||
break;
|
||||
}
|
||||
case 4012: // LINE
|
||||
{
|
||||
BasicGUI_LineDlg *aDlg = new BasicGUI_LineDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4013: // CIRCLE
|
||||
{
|
||||
BasicGUI_CircleDlg *aDlg = new BasicGUI_CircleDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4014: // ELLIPSE
|
||||
{
|
||||
BasicGUI_EllipseDlg *aDlg = new BasicGUI_EllipseDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4015: // ARC
|
||||
{
|
||||
BasicGUI_ArcDlg *aDlg = new BasicGUI_ArcDlg(parent, "", myBasicGUI, Sel);
|
||||
break ;
|
||||
}
|
||||
case 4016: // VECTOR
|
||||
{
|
||||
BasicGUI_VectorDlg *aDlg = new BasicGUI_VectorDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4017: // PLANE
|
||||
{
|
||||
BasicGUI_PlaneDlg *aDlg = new BasicGUI_PlaneDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4018: // WORKING PLANE
|
||||
{
|
||||
BasicGUI_WorkingPlaneDlg *aDlg = new BasicGUI_WorkingPlaneDlg(parent, "", myBasicGUI, Sel);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : 0nMousePress()
|
||||
// purpose : [static] manage mouse events
|
||||
//=================================================================================
|
||||
bool BasicGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
|
||||
{
|
||||
BasicGUI* myBasicGUI = new BasicGUI();
|
||||
|
||||
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||
return false;
|
||||
|
||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
|
||||
|
||||
/* Get the clicked or selected point */
|
||||
gp_Pnt thePoint;
|
||||
|
||||
myBasicGUI->myGeomBase->EraseSimulationShape();
|
||||
BasicGUI_PointDlg *DialogPt = (BasicGUI_PointDlg*)(myBasicGUI->myGeomGUI->GetActiveDialogBox());
|
||||
|
||||
if(DialogPt->UseLocalContext()) {
|
||||
ic->InitSelected();
|
||||
if(pe->state() == Qt::ShiftButton)
|
||||
v3d->getAISSelector()->shiftSelect(); /* Append selection */
|
||||
else
|
||||
v3d->getAISSelector()->select(); /* New selection */
|
||||
|
||||
ic->InitSelected();
|
||||
if(ic->MoreSelected())
|
||||
thePoint = BRep_Tool::Pnt(TopoDS::Vertex(ic->SelectedShape()));
|
||||
else
|
||||
thePoint = myBasicGUI->ConvertClickToPoint(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
|
||||
}
|
||||
else
|
||||
thePoint = myBasicGUI->ConvertClickToPoint(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
|
||||
|
||||
if(DialogPt != 0)
|
||||
DialogPt->PointIntoCoordinates(thePoint, true); /* display point */
|
||||
else
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ConvertClickToPoint()
|
||||
// purpose : Returns the point clicked in 3D view
|
||||
//=======================================================================
|
||||
gp_Pnt BasicGUI::ConvertClickToPoint(Standard_Real x, Standard_Real y, Handle(V3d_View) aView)
|
||||
{
|
||||
V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt;
|
||||
aView->Eye(XEye, YEye, ZEye);
|
||||
|
||||
aView->At(XAt, YAt, ZAt);
|
||||
gp_Pnt EyePoint(XEye, YEye, ZEye);
|
||||
gp_Pnt AtPoint(XAt, YAt, ZAt);
|
||||
|
||||
gp_Vec EyeVector(EyePoint, AtPoint);
|
||||
gp_Dir EyeDir(EyeVector);
|
||||
|
||||
gp_Pln PlaneOfTheView = gp_Pln(AtPoint,EyeDir);
|
||||
Standard_Real X, Y, Z;
|
||||
aView->Convert(x, y, X, Y, Z);
|
||||
gp_Pnt ConvertedPoint(X, Y, Z);
|
||||
|
||||
gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project(PlaneOfTheView, ConvertedPoint);
|
||||
gp_Pnt ResultPoint = ElSLib::Value(ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(), PlaneOfTheView);
|
||||
return ResultPoint;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : MakePointAndDisplay
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void BasicGUI::MakePointAndDisplay(const double x, const double y, const double z)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var P = myGeom->MakeVertex(x, y, z);
|
||||
P->NameType(tr("GEOM_VERTEX"));
|
||||
if (myGeomBase->Display(P))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeLineAndDisplay()
|
||||
// purpose : Create an infinite oriented line (linear edge in fact)
|
||||
//=====================================================================================
|
||||
void BasicGUI::MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint)
|
||||
{
|
||||
gp_Pnt P1, P2;
|
||||
double dx, dy, dz;
|
||||
myGeomBase->GetBipointDxDyDz(InitPoint, LastPoint, dx, dy, dz);
|
||||
Standard_Real length = InitPoint.Distance(LastPoint);
|
||||
if(length <= Precision::Confusion()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real coeff = 1E6 / length;
|
||||
|
||||
/* To create a line with length = 1E6 */
|
||||
/* Precision::Infinite() is 1E100 in OCC */
|
||||
P1.SetX(InitPoint.X() - (coeff * dx));
|
||||
P1.SetY(InitPoint.Y() - (coeff * dy));
|
||||
P1.SetZ(InitPoint.Z() - (coeff * dz));
|
||||
|
||||
P2.SetX(LastPoint.X() + (coeff * dx));
|
||||
P2.SetY(LastPoint.Y() + (coeff * dy));
|
||||
P2.SetZ(LastPoint.Z() + (coeff * dz));
|
||||
|
||||
try {
|
||||
GEOM::PointStruct pstruct = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||
GEOM::PointStruct d = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||
|
||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeLine(pstruct, dstruct);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_LINE"));
|
||||
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeCircleAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BasicGUI::MakeCircleAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir, const Standard_Real Radius)
|
||||
{
|
||||
try {
|
||||
GEOM::PointStruct pstruct = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
|
||||
GEOM::PointStruct d = myGeom->MakePointStruct(dir.X(), dir.Y(), dir.Z());
|
||||
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeCircle(pstruct, dstruct, Radius);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_CIRCLE"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeEllipseAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BasicGUI::MakeEllipseAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
||||
const Standard_Real Major_Radius, const Standard_Real Minor_Radius)
|
||||
{
|
||||
try {
|
||||
GEOM::PointStruct pstruct = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
|
||||
GEOM::PointStruct d = myGeom->MakePointStruct(dir.X(), dir.Y(), dir.Z());
|
||||
GEOM::DirStruct dstruct = myGeom->MakeDirection(d) ;
|
||||
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_ELLIPSE"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================================
|
||||
// function : MakeArcAndDisplay()
|
||||
// purpose : Make an arc of circle from InitPoint to CirclePoint and passing on EndPoint
|
||||
//=======================================================================================
|
||||
void BasicGUI::MakeArcAndDisplay(gp_Pnt InitPoint, gp_Pnt CirclePoint, gp_Pnt EndPoint)
|
||||
{
|
||||
gp_Vec v1(CirclePoint, InitPoint);
|
||||
gp_Vec v2(CirclePoint, EndPoint);
|
||||
if(v1.IsParallel(v2, Precision::Angular()))
|
||||
return;
|
||||
|
||||
try {
|
||||
GEOM::PointStruct pI = myGeom->MakePointStruct(InitPoint.X(), InitPoint.Y(), InitPoint.Z());
|
||||
GEOM::PointStruct pC = myGeom->MakePointStruct(CirclePoint.X(), CirclePoint.Y(), CirclePoint.Z());
|
||||
GEOM::PointStruct pE = myGeom->MakePointStruct(EndPoint.X(), EndPoint.Y(), EndPoint.Z());
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeArc(pI, pC, pE);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_ARC"));
|
||||
if (myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : MakeVectorAndDisplay()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void BasicGUI::MakeVectorAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
||||
{
|
||||
try {
|
||||
GEOM::PointStruct pstruct1 = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||
GEOM::PointStruct pstruct2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||
GEOM::GEOM_Shape_var Vector = myGeom->MakeVector(pstruct1, pstruct2);
|
||||
Vector->NameType(tr("GEOM_VECTOR"));
|
||||
if(myGeomBase->Display(Vector))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : MakePlaneAndDisplay()
|
||||
// purpose : Plane point is P1 and dx, dy, dz define a normal vector
|
||||
//=======================================================================
|
||||
void BasicGUI::MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, const Standard_Real dy,
|
||||
const Standard_Real dz, const Standard_Real TrimSize)
|
||||
{
|
||||
try {
|
||||
gp_Dir aDirection;
|
||||
aDirection.SetCoord(dx, dy, dz);
|
||||
gp_Ax2 Axis(P1, aDirection);
|
||||
|
||||
GEOM::PointStruct pstruct = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||
GEOM::PointStruct d = myGeom->MakePointStruct(aDirection.X(), aDirection.Y(), aDirection.Z());
|
||||
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||
GEOM::GEOM_Shape_ptr plane = myGeom->MakePlane(pstruct, dstruct, TrimSize);
|
||||
plane->NameType(tr("GEOM_PLANE"));
|
||||
if(myGeomBase->Display(plane))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : MakeWorkingPlane()
|
||||
// purpose : Change the point of view3d
|
||||
//=======================================================================
|
||||
void BasicGUI::MakeWorkingPlane(const gp_Pnt P, const gp_Dir D)
|
||||
{
|
||||
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
|
||||
return;
|
||||
}
|
||||
|
||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewPort();
|
||||
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)vp)->getView();
|
||||
view3d->SetAt(P.X(), P.Y(), P.Z());
|
||||
view3d->SetProj(D.X(), D.Y(), D.Z());
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// EXPORTED METHODS
|
||||
//=====================================================================================
|
||||
extern "C"
|
||||
{
|
||||
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{return BasicGUI::OnGUIEvent(theCommandID, parent);}
|
||||
|
||||
bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
|
||||
{return BasicGUI::OnMousePress(pe, parent, studyFrame);}
|
||||
}
|
69
src/BasicGUI/BasicGUI.h
Normal file
@ -0,0 +1,69 @@
|
||||
// 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 : BasicGUI.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef BASICGUI_H
|
||||
#define BASICGUI_H
|
||||
|
||||
#include "GEOMBase.h"
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI : public QObject
|
||||
{
|
||||
Q_OBJECT /* for QT compatibility */
|
||||
|
||||
public :
|
||||
BasicGUI();
|
||||
~BasicGUI();
|
||||
|
||||
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||
static bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
|
||||
|
||||
gp_Pnt ConvertClickToPoint(Standard_Real x, Standard_Real y, Handle(V3d_View) aView);
|
||||
|
||||
void MakePointAndDisplay(const double x, const double y, const double z);
|
||||
void MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint);
|
||||
void MakeCircleAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir, const Standard_Real Radius);
|
||||
void MakeEllipseAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
||||
const Standard_Real Major_Radius, const Standard_Real Minor_Radius);
|
||||
void MakeArcAndDisplay(gp_Pnt InitPoint, gp_Pnt CirclePoint, gp_Pnt EndPoint);
|
||||
void MakeVectorAndDisplay(const gp_Pnt P1, const gp_Pnt P2);
|
||||
void MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, const Standard_Real dy,
|
||||
const Standard_Real dz, const Standard_Real TrimSize);
|
||||
void MakeWorkingPlane(const gp_Pnt P, const gp_Dir D);
|
||||
|
||||
GEOMBase* myGeomBase;
|
||||
GEOMContext* myGeomGUI;
|
||||
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
309
src/BasicGUI/BasicGUI_ArcDlg.cxx
Normal file
@ -0,0 +1,309 @@
|
||||
// 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 : BasicGUI_ArcDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_ArcDlg.h"
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_ArcDlg()
|
||||
// purpose : Constructs a BasicGUI_ArcDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_ArcDlg::BasicGUI_ArcDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_ARC")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_ARC_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_ARC"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_3Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||
GroupPoints->TextLabel3->setText(tr("GEOM_POINT_I").arg("3"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
GroupPoints->PushButton2->setPixmap(image1);
|
||||
GroupPoints->PushButton3->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_ArcDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_ArcDlg::~BasicGUI_ArcDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
myOkPoint1 = myOkPoint2 = myOkPoint3 = 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(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||
myBasicGUI->MakeArcAndDisplay(myPoint1, myPoint2, myPoint3);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if (nbSel != 1) {
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint1 = false;
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkPoint2 = false;
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit3)
|
||||
myOkPoint3 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomBase->VertexToPoint(S, myPoint2)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint2 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit3 && myGeomBase->VertexToPoint(S, myPoint3)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint3 = true;
|
||||
}
|
||||
|
||||
if(myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||
this->MakeArcSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
}
|
||||
else if(send == GroupPoints->PushButton3) {
|
||||
GroupPoints->LineEdit3->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit3;
|
||||
}
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if(send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else if(send == GroupPoints->LineEdit3)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit3;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::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 BasicGUI_ArcDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakeArcSimulationAndDisplay()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::MakeArcSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
try {
|
||||
if(myPoint2.IsEqual(myPoint1, Precision::Confusion()) ||
|
||||
myPoint2.IsEqual(myPoint3, Precision::Confusion())) {
|
||||
myEditCurrentArgument->setText("");
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Vec v1(myPoint2, myPoint1);
|
||||
gp_Vec v2(myPoint2, myPoint3);
|
||||
if(v1.IsParallel(v2, Precision::Angular())) {
|
||||
myEditCurrentArgument->setText("");
|
||||
return;
|
||||
}
|
||||
|
||||
GC_MakeArcOfCircle Arc(myPoint1, myPoint2, myPoint3);
|
||||
if(Arc.IsDone()) {
|
||||
Handle(Geom_TrimmedCurve) curve = Arc.Value();
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(curve).Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE("Exception catched in MakeArcSimulationAndDisplay");
|
||||
}
|
||||
return;
|
||||
}
|
77
src/BasicGUI/BasicGUI_ArcDlg.h
Normal file
@ -0,0 +1,77 @@
|
||||
// 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 : BasicGUI_ArcDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_ARC_H
|
||||
#define DIALOGBOX_ARC_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_3Sel_QTD.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_ArcDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_ArcDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_ArcDlg( QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||
~BasicGUI_ArcDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakeArcSimulationAndDisplay();
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint1;
|
||||
gp_Pnt myPoint2;
|
||||
gp_Pnt myPoint3;
|
||||
bool myOkPoint1;
|
||||
bool myOkPoint2;
|
||||
bool myOkPoint3;
|
||||
|
||||
DlgRef_3Sel_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_ARC_H
|
311
src/BasicGUI/BasicGUI_CircleDlg.cxx
Normal file
@ -0,0 +1,311 @@
|
||||
// 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 : BasicGUI_CircleDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_CircleDlg.h"
|
||||
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include "QAD_Config.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_CircleDlg()
|
||||
// purpose : Constructs a BasicGUI_CircleDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_CircleDlg::BasicGUI_CircleDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_CIRCLE_PV")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_CIRCLE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_CIRCLE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel1Spin(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER_POINT"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
GroupPoints->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_CircleDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_CircleDlg::~BasicGUI_CircleDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myRadius = 100.0;
|
||||
myOkPoint1 = myOkDir = false;
|
||||
|
||||
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||
step = St.toDouble();
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||
GroupPoints->SpinBox_DX->SetValue(myRadius);
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myOkPoint1 && myOkDir)
|
||||
myBasicGUI->MakeCircleAndDisplay(myPoint1, myDir, myRadius);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if (nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint1 = false;
|
||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkDir = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
/* gp_Pnt : not used */
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
GroupPoints->LineEdit1->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(S));
|
||||
myDir = curv.Line().Direction();
|
||||
GroupPoints->LineEdit2->setText(aString);
|
||||
myOkDir = true;
|
||||
}
|
||||
|
||||
if(myOkPoint1 && myOkDir)
|
||||
this->MakeCircleSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
}
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if (send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
if(!mySimulationTopoDs.IsNull())
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::ValueChangedInSpinBox(double newValue)
|
||||
{
|
||||
myRadius = newValue;
|
||||
if(myOkPoint1 && myOkDir)
|
||||
MakeCircleSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakeCircleSimulationAndDisplay()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CircleDlg::MakeCircleSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
try {
|
||||
gp_Ax2 anAxis(myPoint1, myDir);
|
||||
gp_Circ circ(anAxis, myRadius);
|
||||
BRepBuilderAPI_MakeEdge MakeEdge(circ);
|
||||
mySimulationTopoDs = MakeEdge.Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE("Exception catched in MakeCircleSimulationAndDisplay");
|
||||
}
|
||||
return;
|
||||
}
|
82
src/BasicGUI/BasicGUI_CircleDlg.h
Normal file
@ -0,0 +1,82 @@
|
||||
// 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 : BasicGUI_CircleDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_CIRCLE_H
|
||||
#define DIALOGBOX_CIRCLE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel1Spin.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#include <gp_Dir.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_CircleDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_CircleDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_CircleDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BasicGUI_CircleDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakeCircleSimulationAndDisplay();
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
double step;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter;
|
||||
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint1;
|
||||
gp_Dir myDir;
|
||||
Standard_Real myRadius;
|
||||
bool myOkPoint1;
|
||||
bool myOkDir;
|
||||
|
||||
DlgRef_2Sel1Spin* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ValueChangedInSpinBox(double newValue);
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_CIRCLE_H
|
325
src/BasicGUI/BasicGUI_EllipseDlg.cxx
Normal file
@ -0,0 +1,325 @@
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
//
|
||||
// Copyright (C) 2003 OPEN CASCADE
|
||||
//
|
||||
// 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 : BasicGUI_EllipseDlg.cxx
|
||||
// Author : Nicolas REJNERI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_EllipseDlg.h"
|
||||
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Elips.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include "QAD_Config.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_EllipseDlg()
|
||||
// purpose : Constructs a BasicGUI_EllipseDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_ELLIPSE_PV")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_ELLIPSE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_ELLIPSE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_MINOR"));
|
||||
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_MAJOR"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
GroupPoints->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_EllipseDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_EllipseDlg::~BasicGUI_EllipseDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myMajorRadius = 200.0;
|
||||
myMinorRadius = 100.0;
|
||||
myOkPoint = myOkDir = false;
|
||||
|
||||
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||
step = St.toDouble();
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||
GroupPoints->SpinBox_DX->SetValue(myMajorRadius);
|
||||
GroupPoints->SpinBox_DY->SetValue(myMinorRadius);
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myOkPoint && myOkDir)
|
||||
myBasicGUI->MakeEllipseAndDisplay(myPoint, myDir, myMajorRadius, myMinorRadius);
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if (nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint = false;
|
||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkDir = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
/* gp_Pnt : not used */
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint)) {
|
||||
GroupPoints->LineEdit1->setText(aString);
|
||||
myOkPoint = true;
|
||||
}
|
||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||
BRepAdaptor_Curve curv(TopoDS::Edge(S));
|
||||
myDir = curv.Line().Direction();
|
||||
GroupPoints->LineEdit2->setText(aString);
|
||||
myOkDir = true;
|
||||
}
|
||||
|
||||
if(myOkPoint && myOkDir)
|
||||
this->MakeEllipseSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
}
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if (send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
if(!mySimulationTopoDs.IsNull())
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::ValueChangedInSpinBox(double newValue)
|
||||
{
|
||||
QObject* send = (QObject*)sender();
|
||||
|
||||
if(send == GroupPoints->SpinBox_DX )
|
||||
myMajorRadius = newValue;
|
||||
else if(send == GroupPoints->SpinBox_DY)
|
||||
myMinorRadius = newValue;
|
||||
|
||||
if (myOkPoint && myOkDir)
|
||||
MakeEllipseSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakeEllipseSimulationAndDisplay()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_EllipseDlg::MakeEllipseSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myMajorRadius < myMinorRadius)
|
||||
return;
|
||||
|
||||
try {
|
||||
gp_Ax2 anAxis(myPoint, myDir);
|
||||
gp_Elips ellipse(anAxis, myMajorRadius, myMinorRadius);
|
||||
BRepBuilderAPI_MakeEdge MakeEdge(ellipse);
|
||||
mySimulationTopoDs = MakeEdge.Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE("Exception catched in MakeEllipseSimulationAndDisplay");
|
||||
}
|
||||
return;
|
||||
}
|
83
src/BasicGUI/BasicGUI_EllipseDlg.h
Normal file
@ -0,0 +1,83 @@
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
//
|
||||
// Copyright (C) 2003 OPEN CASCADE
|
||||
//
|
||||
// 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 : BasicGUI_EllipseDlg.h
|
||||
// Author : Nicolas REJNERI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef BASICGUI_ELLIPSE_H
|
||||
#define BASICGUI_ELLIPSE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel2Spin.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#include <gp_Dir.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_EllipseDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_EllipseDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_EllipseDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BasicGUI_EllipseDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakeEllipseSimulationAndDisplay();
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
double step;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter;
|
||||
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint; /* Central point of ellipse */
|
||||
bool myOkPoint; /* true when myPoint is defined */
|
||||
gp_Dir myDir; /* to set normal axis of ellipse */
|
||||
bool myOkDir; /* true when myPoint is defined */
|
||||
|
||||
Standard_Real myMajorRadius;
|
||||
Standard_Real myMinorRadius;
|
||||
|
||||
DlgRef_2Sel2Spin* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ValueChangedInSpinBox(double newValue);
|
||||
|
||||
};
|
||||
|
||||
#endif // BASICGUI_ELLIPSE_H
|
290
src/BasicGUI/BasicGUI_LineDlg.cxx
Normal file
@ -0,0 +1,290 @@
|
||||
// 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 : BasicGUI_LineDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_LineDlg.h"
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_LineDlg()
|
||||
// purpose : Constructs a BasicGUI_LineDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_LineDlg::BasicGUI_LineDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_LINE_2P")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_LINE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_LINE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
GroupPoints->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_LineDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_LineDlg::~BasicGUI_LineDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(0.0, 0.0, 0.0);
|
||||
myOkPoint1 = myOkPoint2 = 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(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myOkPoint1 && myOkPoint2)
|
||||
myBasicGUI->MakeLineAndDisplay(myPoint1, myPoint2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint1 = false;
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkPoint2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomBase->VertexToPoint(S, myPoint2)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint2 = true;
|
||||
}
|
||||
|
||||
if(myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion())
|
||||
this->MakeLineSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
}
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if(send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::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 BasicGUI_LineDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakeLineSimulationAndDisplay()
|
||||
// purpose : An arrow (cone topology) is added to 'modifiedShape'
|
||||
// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'.
|
||||
// : If an arrow can't be added returns false and 'modifiedShape' isn't modified !
|
||||
//=================================================================================
|
||||
void BasicGUI_LineDlg::MakeLineSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
try {
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
TopoDS_Shape arrow;
|
||||
if(myGeomBase->CreateArrowForLinearEdge(mySimulationTopoDs, arrow)) {
|
||||
TopoDS_Compound Comp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound (Comp);
|
||||
B.Add(Comp, mySimulationTopoDs);
|
||||
B.Add(Comp, arrow);
|
||||
mySimulationTopoDs = Comp;
|
||||
}
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE("Exception catched in MakeLineSimulationAndDisplay");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
75
src/BasicGUI/BasicGUI_LineDlg.h
Normal file
@ -0,0 +1,75 @@
|
||||
// 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 : BasicGUI_LineDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_LINE_H
|
||||
#define DIALOGBOX_LINE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_LineDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_LineDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_LineDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BasicGUI_LineDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakeLineSimulationAndDisplay();
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint1; /* Points containing the vector */
|
||||
gp_Pnt myPoint2;
|
||||
bool myOkPoint1; /* Are true when myPoint is defined */
|
||||
bool myOkPoint2;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_LINE_H
|
588
src/BasicGUI/BasicGUI_PlaneDlg.cxx
Normal file
@ -0,0 +1,588 @@
|
||||
// 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 : BasicGUI_PlaneDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_PlaneDlg.h"
|
||||
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include "QAD_Config.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_PlaneDlg()
|
||||
// purpose : Constructs a BasicGUI_PlaneDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_PLANE_PV")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_DXYZ")));
|
||||
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE")));
|
||||
QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_PLANE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_PLANE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->setPixmap(image1);
|
||||
RadioButton3->setPixmap(image2);
|
||||
|
||||
GroupPointDirection = new DlgRef_2Sel1Spin(this, "GroupPointDirection");
|
||||
GroupPointDirection->GroupBox1->setTitle(tr("GEOM_PLANE_PV"));
|
||||
GroupPointDirection->TextLabel1->setText(tr("GEOM_POINT"));
|
||||
GroupPointDirection->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||
GroupPointDirection->TextLabel3->setText(tr("GEOM_PLANE_SIZE"));
|
||||
GroupPointDirection->PushButton1->setPixmap(image3);
|
||||
GroupPointDirection->PushButton2->setPixmap(image3);
|
||||
|
||||
GroupPointPlusCoordinates = new DlgRef_1Sel4Spin(this, "GroupPointPlusCoordinates" );
|
||||
GroupPointPlusCoordinates->GroupBox1->setTitle(tr("GEOM_PLANE_PVC"));
|
||||
GroupPointPlusCoordinates->TextLabel1->setText(tr("GEOM_POINT"));
|
||||
GroupPointPlusCoordinates->TextLabel2->setText(tr("GEOM_COOR"));
|
||||
GroupPointPlusCoordinates->TextLabel3->setText(tr("GEOM_DX"));
|
||||
GroupPointPlusCoordinates->TextLabel4->setText(tr("GEOM_DY"));
|
||||
GroupPointPlusCoordinates->TextLabel5->setText(tr("GEOM_DZ"));
|
||||
GroupPointPlusCoordinates->TextLabel6->setText(tr("GEOM_PLANE_SIZE"));
|
||||
GroupPointPlusCoordinates->PushButton1->setPixmap(image3);
|
||||
|
||||
GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace");
|
||||
GroupFace->GroupBox1->setTitle(tr("GEOM_FACE"));
|
||||
GroupFace->TextLabel1->setText(tr("GEOM_SELECTION"));
|
||||
GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
|
||||
GroupFace->PushButton1->setPixmap(image3);
|
||||
|
||||
Layout1->addWidget(GroupPointDirection, 1, 0);
|
||||
Layout1->addWidget(GroupPointPlusCoordinates, 1, 0);
|
||||
Layout1->addWidget(GroupFace, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_PlaneDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myConstructorId = 0;
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
|
||||
|
||||
/* Filters definition */
|
||||
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||
/* Filter for the next selection */
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||
step = St.toDouble();
|
||||
this->myTrimSize = 2000.0;
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
GroupPointDirection->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, step, 3);
|
||||
GroupPointDirection->SpinBox_DX->SetValue(myTrimSize);
|
||||
|
||||
double SpecificStep = 1;
|
||||
GroupPointPlusCoordinates->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3);
|
||||
GroupPointPlusCoordinates->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3);
|
||||
GroupPointPlusCoordinates->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3);
|
||||
GroupPointPlusCoordinates->SpinBox_DX->SetValue(0.0);
|
||||
GroupPointPlusCoordinates->SpinBox_DY->SetValue(0.0);
|
||||
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
|
||||
GroupPointPlusCoordinates->SpinBox_S->RangeStepAndValidator(0.001, 10000000.0, step, 3);
|
||||
GroupPointPlusCoordinates->SpinBox_S->SetValue(myTrimSize) ;
|
||||
|
||||
GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, step, 3);
|
||||
GroupFace->SpinBox_DX->SetValue(myTrimSize);
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
|
||||
|
||||
connect(GroupPointDirection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPointDirection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPointPlusCoordinates->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupFace->PushButton1, SIGNAL(clicked()), this, SLOT( SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPointDirection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPointDirection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPointPlusCoordinates->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupFace->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupPointPlusCoordinates->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPointPlusCoordinates->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPointPlusCoordinates->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPointPlusCoordinates->SpinBox_S, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPointDirection->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DY, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_DZ, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointPlusCoordinates->SpinBox_S, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPointDirection->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupFace->SpinBox_DX, SLOT(SetStep(double)));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* Displays Dialog */
|
||||
GroupPointPlusCoordinates->hide();
|
||||
GroupFace->hide();
|
||||
GroupPointDirection->show();
|
||||
this->show();
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose : Radio button management
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
|
||||
{
|
||||
myConstructorId = constructorId;
|
||||
mySelection->ClearFilters();
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0: /* plane from a point and a direction (vector, edge...) */
|
||||
{
|
||||
GroupPointPlusCoordinates->hide();
|
||||
GroupFace->hide();
|
||||
resize(0, 0);
|
||||
GroupPointDirection->show();
|
||||
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||
GroupPointDirection->LineEdit1->setText(tr(""));
|
||||
GroupPointDirection->LineEdit2->setText(tr(""));
|
||||
|
||||
/* for the first argument */
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
break;
|
||||
}
|
||||
case 1: /* plane from a point and vector coordinates */
|
||||
{
|
||||
GroupPointDirection->hide();
|
||||
GroupFace->hide();
|
||||
resize(0, 0);
|
||||
GroupPointPlusCoordinates->show();
|
||||
|
||||
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||
GroupPointPlusCoordinates->LineEdit1->setText(tr(""));
|
||||
GroupPointPlusCoordinates->SpinBox_DX->SetValue(0.0);
|
||||
GroupPointPlusCoordinates->SpinBox_DY->SetValue(0.0);
|
||||
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
|
||||
myOkCoordinates = true;
|
||||
|
||||
/* for the first argument */
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
break;
|
||||
}
|
||||
case 2: /* plane from a planar face selection */
|
||||
{
|
||||
GroupPointDirection->hide();
|
||||
GroupPointPlusCoordinates->hide();
|
||||
resize(0, 0);
|
||||
GroupFace->show();
|
||||
|
||||
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||
GroupFace->LineEdit1->setText(tr(""));
|
||||
|
||||
/* for the first argument */
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0 : /* args are myPoint1 and myDx, myDy, myDz from a vector(edge) */
|
||||
{
|
||||
if(myOkPoint1 && myOkDirection)
|
||||
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||
break;
|
||||
}
|
||||
case 1 : /* args are myPoint1 and myDx, myDy, myDz from a Spin Box */
|
||||
{
|
||||
if(myOkPoint1)
|
||||
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||
break;
|
||||
}
|
||||
case 2 : /* arg is a planar face selection */
|
||||
{
|
||||
if(myOkPlanarFace)
|
||||
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection has changed
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
switch (myConstructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if(myEditCurrentArgument == GroupPointDirection->LineEdit1) {
|
||||
GroupPointDirection->LineEdit1->setText("");
|
||||
myOkPoint1 = false ;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPointDirection->LineEdit2) {
|
||||
GroupPointDirection->LineEdit2->setText("");
|
||||
myOkDirection = false ;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1) {
|
||||
GroupPointPlusCoordinates->LineEdit1->setText("") ;
|
||||
myOkPoint1 = false ;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if(myEditCurrentArgument == GroupFace->LineEdit1) {
|
||||
GroupFace->LineEdit1->setText("") ;
|
||||
if(aString.compare("") == 0)
|
||||
myOkPlanarFace = false;
|
||||
else
|
||||
myOkPlanarFace = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return ;
|
||||
|
||||
/* FIRST CONSTRUCTOR */
|
||||
if(myEditCurrentArgument == GroupPointDirection->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
GroupPointDirection->LineEdit1->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if( myEditCurrentArgument == GroupPointDirection->LineEdit2) {
|
||||
/* We verify if the selection is a linear edge */
|
||||
gp_Pnt Pfirst, Plast;
|
||||
if( myGeomBase->LinearEdgeExtremities(S, Pfirst, Plast)) {
|
||||
myGeomBase->GetBipointDxDyDz(Pfirst, Plast, myDx, myDy, myDz);
|
||||
GroupPointDirection->LineEdit2->setText(aString);
|
||||
myOkDirection = true;
|
||||
myTrimSize = GroupPointDirection->SpinBox_DX->GetValue();
|
||||
}
|
||||
}
|
||||
|
||||
/* SECOND CONSTRUCTOR */
|
||||
else if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
GroupPointPlusCoordinates->LineEdit1->setText(aString);
|
||||
/* Get arguments */
|
||||
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
|
||||
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
|
||||
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
|
||||
myTrimSize = GroupPointPlusCoordinates->SpinBox_S->GetValue();
|
||||
myOkPoint1 = true;
|
||||
myOkCoordinates = true;
|
||||
}
|
||||
|
||||
/* THIRD CONSTRUCTOR */
|
||||
else if(myEditCurrentArgument == GroupFace->LineEdit1) {
|
||||
if(myOkPlanarFace) {
|
||||
GroupFace->LineEdit1->setText(aString);
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(S));
|
||||
gp_Pln Plane = surf.Plane();
|
||||
|
||||
gp_Pnt myPoint1 = Plane.Location();
|
||||
gp_Ax1 ax = Plane.Axis();
|
||||
myDx = (ax.Direction()).X();
|
||||
myDy = (ax.Direction()).Y();
|
||||
myDz = (ax.Direction()).Z();
|
||||
myTrimSize = GroupFace->SpinBox_DX->GetValue();
|
||||
}
|
||||
}
|
||||
|
||||
/* Call method simulation */
|
||||
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
|
||||
if(myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion()*Precision::Confusion())
|
||||
this->MakePlaneSimulationAndDisplay();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if(send == GroupPointDirection->PushButton1) {
|
||||
GroupPointDirection->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
}
|
||||
else if(send == GroupPointDirection->PushButton2) {
|
||||
GroupPointDirection->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit2;
|
||||
/* Edge filter here */
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if(send == GroupPointPlusCoordinates->PushButton1) {
|
||||
GroupPointPlusCoordinates->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||
/* Vertex filter here */
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if(send == GroupFace->PushButton1) {
|
||||
GroupFace->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||
/* Face filter here */
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPointDirection->LineEdit1)
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||
else if (send == GroupPointDirection->LineEdit2)
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit2;
|
||||
else if (send == GroupPointPlusCoordinates->LineEdit1)
|
||||
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||
else if (send == GroupFace->LineEdit1)
|
||||
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
GroupPointDirection->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
GroupPointPlusCoordinates->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
GroupFace->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!mySimulationTopoDs.IsNull())
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::ValueChangedInSpinBox(double newValue)
|
||||
{
|
||||
QObject* send = (QObject*)sender();
|
||||
|
||||
if(send == GroupPointPlusCoordinates->SpinBox_DX)
|
||||
myDx = newValue;
|
||||
else if(send == GroupPointPlusCoordinates->SpinBox_DY)
|
||||
myDy = newValue;
|
||||
else if(send == GroupPointPlusCoordinates->SpinBox_DZ)
|
||||
myDz = newValue;
|
||||
else if(send == GroupPointDirection->SpinBox_DX || send == GroupPointPlusCoordinates->SpinBox_S || send == GroupFace->SpinBox_DX) {
|
||||
myTrimSize = newValue;
|
||||
} else
|
||||
return;
|
||||
|
||||
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
|
||||
if(myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion() * Precision::Confusion())
|
||||
this->MakePlaneSimulationAndDisplay();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakePlaneSimulationAndDisplay(()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PlaneDlg::MakePlaneSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
try {
|
||||
gp_Dir aDirection(myDx, myDy, myDz);
|
||||
/* We make a trimmed plane */
|
||||
gp_Pln gplane(myPoint1, aDirection);
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeFace(gplane, -myTrimSize, +myTrimSize, -myTrimSize, +myTrimSize);
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE( "Exception catched in MakePlaneSimulation" << endl );
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
95
src/BasicGUI/BasicGUI_PlaneDlg.h
Normal file
@ -0,0 +1,95 @@
|
||||
// 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 : BasicGUI_PlaneDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_PLANE_H
|
||||
#define DIALOGBOX_PLANE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel1Spin.h"
|
||||
#include "DlgRef_1Sel4Spin.h"
|
||||
#include "DlgRef_1Sel1Spin.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "GEOM_FaceFilter.hxx"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_PlaneDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_PlaneDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_PlaneDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BasicGUI_PlaneDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakePlaneSimulationAndDisplay();
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
double step;
|
||||
int myConstructorId;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */
|
||||
Handle(GEOM_ShapeTypeFilter) myEdgeFilter;
|
||||
Handle(GEOM_FaceFilter) myFaceFilter;
|
||||
|
||||
gp_Pnt myPoint1; /* Point on the plane */
|
||||
|
||||
Standard_Real myDx;
|
||||
Standard_Real myDy;
|
||||
Standard_Real myDz;
|
||||
Standard_Real myTrimSize;
|
||||
|
||||
bool myOkPoint1; /* true when argument is defined */
|
||||
bool myOkDirection;
|
||||
bool myOkCoordinates;
|
||||
bool myOkPlanarFace;
|
||||
|
||||
DlgRef_2Sel1Spin* GroupPointDirection;
|
||||
DlgRef_1Sel4Spin* GroupPointPlusCoordinates;
|
||||
DlgRef_1Sel1Spin* GroupFace;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void SetEditCurrentArgument();
|
||||
void ConstructorsClicked(int constructorId);
|
||||
void ValueChangedInSpinBox(double newValue);
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_PLANE_H
|
566
src/BasicGUI/BasicGUI_PointDlg.cxx
Normal file
@ -0,0 +1,566 @@
|
||||
// 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 : BasicGUI_PointDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_PointDlg.h"
|
||||
|
||||
#include "QAD_RightFrame.h"
|
||||
#include "OCCViewer_Viewer3d.h"
|
||||
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#if OCC_VERSION_MAJOR >= 5
|
||||
#include <BRepAlgo.hxx>
|
||||
#else
|
||||
#include <BRepAlgoAPI.hxx>
|
||||
#endif
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_PointDlg()
|
||||
// purpose : Constructs a BasicGUI_PointDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_PointDlg::BasicGUI_PointDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, SALOME_Selection* Sel, const 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_POINT")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_POINT_EDGE")));
|
||||
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_POINT_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_POINTS"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->setPixmap(image1);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_3Spin(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_X"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_Y"));
|
||||
GroupPoints->TextLabel3->setText(tr("GEOM_Z"));
|
||||
|
||||
GroupDimensions = new DlgRef_1Sel1Spin(this, "GroupDimensions");
|
||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_PARAM_POINT"));
|
||||
GroupDimensions->TextLabel1->setText(tr("GEOM_EDGE"));
|
||||
GroupDimensions->TextLabel2->setText(tr("GEOM_PARAMETER"));
|
||||
GroupDimensions->PushButton1->setPixmap(image2);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
Layout1->addWidget(GroupDimensions, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init(ic);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ~BasicGUI_PointDlg()
|
||||
// purpose : Destructor
|
||||
//=======================================================================
|
||||
BasicGUI_PointDlg::~BasicGUI_PointDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::Init(const Handle(AIS_InteractiveContext)& ic)
|
||||
{
|
||||
/* init variables */
|
||||
myConstructorId = 0;
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
|
||||
myIC = ic;
|
||||
myParameter = 0.50;
|
||||
myPoint.SetCoord(0.0, 0.0, 0.0);
|
||||
myOkEdge = false;
|
||||
|
||||
myGeomGUI->myState = 0;
|
||||
|
||||
/* Vertices Filter for all arguments */
|
||||
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||
step = St.toDouble();
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
double specificStep = 0.1;
|
||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999999.99999, 999999.99999, specificStep, 5);
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
GroupPoints->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
GroupDimensions->SpinBox_DX->SetValue(myParameter);
|
||||
GroupPoints->SpinBox_DX->SetValue(0.0);
|
||||
GroupPoints->SpinBox_DY->SetValue(0.0);
|
||||
GroupPoints->SpinBox_DZ->SetValue(0.0);
|
||||
|
||||
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
myLocalContextId = myIC->OpenLocalContext();
|
||||
//myGeomBase->SetDisplayedObjectList();
|
||||
/* sub shapes selection */
|
||||
myLocalContextMode = TopAbs_VERTEX;
|
||||
myIC->ActivateStandardMode(myLocalContextMode);
|
||||
myUseLocalContext = true;
|
||||
}
|
||||
else
|
||||
myUseLocalContext = false;
|
||||
|
||||
TopoDS_Shape S;
|
||||
bool displayPoint = true;
|
||||
if(myGeomBase->GetTopoFromSelection(mySelection, S)) {
|
||||
/* Filter a possibly previous selection and try to put it into coordinates */
|
||||
if(myGeomBase->VertexToPoint(S, myPoint))
|
||||
displayPoint = false;
|
||||
}
|
||||
this->PointIntoCoordinates(myPoint, displayPoint);
|
||||
|
||||
/* 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(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
||||
|
||||
connect(GroupDimensions->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupDimensions->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double)));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupDimensions->hide();
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose : Radio button management
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
||||
{
|
||||
myConstructorId = constructorId;
|
||||
mySelection->ClearFilters();
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
disconnect(mySelection, 0, this, 0);
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if(myUseLocalContext == false && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
myLocalContextId = myIC->OpenLocalContext();
|
||||
//myGeomBase->SetDisplayedObjectList();
|
||||
/* sub shapes selection */
|
||||
myLocalContextMode = TopAbs_VERTEX;
|
||||
myIC->ActivateStandardMode(myLocalContextMode);
|
||||
myUseLocalContext = true;
|
||||
}
|
||||
|
||||
GroupDimensions->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints->show();
|
||||
|
||||
/* Display point simulation */
|
||||
PointIntoCoordinates(myPoint, true);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if(myUseLocalContext == true && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
myIC->CloseLocalContext(myLocalContextId);
|
||||
myUseLocalContext = false;
|
||||
}
|
||||
|
||||
GroupPoints->hide();
|
||||
resize(0, 0);
|
||||
GroupDimensions->show();
|
||||
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
GroupDimensions->LineEdit1->setText("");
|
||||
myOkEdge = false;
|
||||
|
||||
/* filter for next selections */
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
this->ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if(mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
/* Close local context */
|
||||
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
myIC->CloseLocalContext(myLocalContextId);
|
||||
myUseLocalContext = false;
|
||||
}
|
||||
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
/* Recup args and call method */
|
||||
double x = GroupPoints->SpinBox_DX->GetValue();
|
||||
double y = GroupPoints->SpinBox_DY->GetValue();
|
||||
double z = GroupPoints->SpinBox_DZ->GetValue();
|
||||
|
||||
myBasicGUI->MakePointAndDisplay(x,y,z); /* WARNING : no display if a local context is opened */
|
||||
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
/* no display if a local context is opened */
|
||||
myLocalContextId = myIC->OpenLocalContext();
|
||||
//myGeomBase->SetDisplayedObjectList();
|
||||
/* sub shapes selection */
|
||||
myLocalContextMode = TopAbs_VERTEX;
|
||||
myIC->ActivateStandardMode(myLocalContextMode);
|
||||
myUseLocalContext = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1 :
|
||||
{
|
||||
if(myOkEdge == true) {
|
||||
/* this constructor method has no idl interface : we use same than constructor 0 */
|
||||
myBasicGUI->MakePointAndDisplay(myPoint.X(), myPoint.Y(), myPoint.Z());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ClickOnCancel()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void BasicGUI_PointDlg::ClickOnCancel()
|
||||
{
|
||||
if(myConstructorId == 0 && 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(myIC->HasOpenedContext()) {
|
||||
myIC->CloseLocalContext(myLocalContextId);
|
||||
myUseLocalContext = false;
|
||||
}
|
||||
}
|
||||
|
||||
myGeomGUI->myState = -1;
|
||||
GEOMBase_Skeleton::ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed (for constructors not using local context)
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
myOkEdge = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(S.ShapeType() == TopAbs_EDGE) {
|
||||
if(CalculateVertexOnCurve(TopoDS::Edge(S), myParameter, mySimulationTopoDs)) {
|
||||
if(myGeomBase->VertexToPoint(mySimulationTopoDs, myPoint)) {
|
||||
GroupDimensions->LineEdit1->setText(aString);
|
||||
myOkEdge = true;
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupDimensions->LineEdit1)
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupDimensions->PushButton1) {
|
||||
GroupDimensions->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
this->SelectionIntoArgument();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : to reactivate this dialog box when mouse enter onto the window
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : closeEvent()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void BasicGUI_PointDlg::closeEvent(QCloseEvent* e)
|
||||
{
|
||||
/* same than click on cancel button */
|
||||
this->ClickOnCancel();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::ActivateThisDialog( )
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
myGeomGUI->myState = 0;
|
||||
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();
|
||||
myLocalContextId = myIC->OpenLocalContext();
|
||||
//myGeomBase->SetDisplayedObjectList();
|
||||
/* sub shapes selection */
|
||||
myLocalContextMode = TopAbs_VERTEX;
|
||||
myIC->ActivateStandardMode(myLocalContextMode);
|
||||
myUseLocalContext = true;
|
||||
}
|
||||
|
||||
if(myConstructorId == 1)
|
||||
mySelection->AddFilter(myEdgeFilter);
|
||||
|
||||
if(!mySimulationTopoDs.IsNull())
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : DeactivateActiveDialog()
|
||||
// purpose : public slot to deactivate if active
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::DeactivateActiveDialog()
|
||||
{
|
||||
if(myConstructorId == 0 && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||
myIC->CloseLocalContext(myLocalContextId);
|
||||
myUseLocalContext = false;
|
||||
}
|
||||
myGeomGUI->myState = -1;
|
||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
|
||||
{
|
||||
DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
|
||||
double vx, vy, vz;
|
||||
|
||||
if(send == GroupPoints->SpinBox_DX) {
|
||||
vx = newValue;
|
||||
vy = GroupPoints->SpinBox_DY->GetValue();
|
||||
vz = GroupPoints->SpinBox_DZ->GetValue();
|
||||
} else if(send == GroupPoints->SpinBox_DY) {
|
||||
vx = GroupPoints->SpinBox_DX->GetValue();
|
||||
vy = newValue;
|
||||
vz = GroupPoints->SpinBox_DZ->GetValue();
|
||||
} else if(send == GroupPoints->SpinBox_DZ) {
|
||||
vx = GroupPoints->SpinBox_DX->GetValue();
|
||||
vy = GroupPoints->SpinBox_DY->GetValue();
|
||||
vz = newValue;
|
||||
} else if(send == GroupDimensions->SpinBox_DX) {
|
||||
myParameter = newValue;
|
||||
} else
|
||||
return;
|
||||
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0: // default constructor
|
||||
{
|
||||
myPoint.SetCoord(vx, vy, vz);
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeVertex (myPoint).Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
this->SelectionIntoArgument();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : CalculateVertexOnCurve()
|
||||
// purpose : Calculate a Vertex on the curve given by 'anEdge'.
|
||||
// : The position of resultVertex is given by aParameter.
|
||||
// : For a linear edge, aParameter=0.0 gives the first vertex of edge
|
||||
// : aParameter=1.0 gives the last vertex of edge
|
||||
// : aParameter=0.5 gives the vertex on the middle of edge
|
||||
// : It is possible to get vertices out of edge using values > 1.0 or < 0.0
|
||||
//=================================================================================
|
||||
bool BasicGUI_PointDlg::CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex)
|
||||
{
|
||||
#if OCC_VERSION_MAJOR >= 5
|
||||
if(anEdge.IsNull() || !BRepAlgo::IsValid(anEdge))
|
||||
#else
|
||||
if(anEdge.IsNull() || !BRepAlgoAPI::IsValid(anEdge))
|
||||
#endif
|
||||
return false;
|
||||
|
||||
Standard_Real first, last;
|
||||
Handle(Geom_Curve) curv = BRep_Tool::Curve(anEdge, first, last);
|
||||
if(!curv->IsCN(0))
|
||||
return false;
|
||||
|
||||
Standard_Real param;
|
||||
if(anEdge.Orientation() == TopAbs_FORWARD)
|
||||
param = first + (last-first) * aParameter;
|
||||
else
|
||||
param = last + (first-last) * aParameter;
|
||||
|
||||
gp_Pnt paramPoint;
|
||||
curv->D0(param, paramPoint);
|
||||
resultVertex = BRepBuilderAPI_MakeVertex(paramPoint);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// funcion : PointIntoCoordinates()
|
||||
// purpose : Sets user point coordinates into this dialog Spin boxes
|
||||
// : and displays it or not according to 'bool displayPoint'
|
||||
//=======================================================================
|
||||
void BasicGUI_PointDlg::PointIntoCoordinates(gp_Pnt P, bool displayPoint)
|
||||
{
|
||||
GroupPoints->SpinBox_DX->SetValue(P.X());
|
||||
GroupPoints->SpinBox_DY->SetValue(P.Y());
|
||||
GroupPoints->SpinBox_DZ->SetValue(P.Z());
|
||||
myPoint.SetCoord(P.X(), P.Y(), P.Z());
|
||||
if(displayPoint) {
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeVertex(P).Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
return;
|
||||
}
|
101
src/BasicGUI/BasicGUI_PointDlg.h
Normal file
@ -0,0 +1,101 @@
|
||||
// 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 : BasicGUI_PointDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_POINT_H
|
||||
#define DIALOGBOX_POINT_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel1Spin.h"
|
||||
#include "DlgRef_3Spin.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
#include <TopoDS_Edge.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_PointDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_PointDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_PointDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, const Handle(AIS_InteractiveContext)& ic = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
|
||||
~BasicGUI_PointDlg();
|
||||
|
||||
private :
|
||||
void Init(const Handle(AIS_InteractiveContext)& ic);
|
||||
void enterEvent(QEvent* e);
|
||||
void closeEvent(QCloseEvent* e);
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
double step;
|
||||
int myConstructorId;
|
||||
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* filter for selection */
|
||||
|
||||
gp_Pnt myPoint; /* Is 'mySimulationTopoDs' */
|
||||
bool myOkEdge; /* true when an edge is selected by user */
|
||||
double myParameter; /* Parameter used to create a vertex on edge (point on curve) */
|
||||
|
||||
/* Interactive and local context management see also : bool UseLocalContext() */
|
||||
Handle(AIS_InteractiveContext) myIC; /* Interactive context from IAPP */
|
||||
Standard_Integer myLocalContextId; /* identify a local context for this method */
|
||||
TopAbs_ShapeEnum myLocalContextMode; /* identify a selection mode into local context */
|
||||
bool myUseLocalContext; /* true when method as opened a local context */
|
||||
|
||||
DlgRef_1Sel1Spin* GroupDimensions;
|
||||
DlgRef_3Spin* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnCancel();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void DeactivateActiveDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ConstructorsClicked(int constructorId);
|
||||
void ValueChangedInSpinBox(double newValue);
|
||||
|
||||
bool CalculateVertexOnCurve(const TopoDS_Edge& anEdge,
|
||||
const Standard_Real aParameter,
|
||||
TopoDS_Shape& resultVertex);
|
||||
|
||||
public:
|
||||
void PointIntoCoordinates(gp_Pnt P, bool displayPoint);
|
||||
/* return true if method has opened a local context */
|
||||
bool UseLocalContext(){return myUseLocalContext;};
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_POINT_H
|
467
src/BasicGUI/BasicGUI_VectorDlg.cxx
Normal file
@ -0,0 +1,467 @@
|
||||
// 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 : BasicGUI_VectorDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_VectorDlg.h"
|
||||
|
||||
#include "QAD_Config.h"
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_VectorDlg()
|
||||
// purpose : Constructs a BasicGUI_VectorDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_VectorDlg::BasicGUI_VectorDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_VECTOR_2P")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_DXYZ")));
|
||||
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_VECTOR_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_VECTOR"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->setPixmap(image1);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||
GroupPoints->PushButton1->setPixmap(image2);
|
||||
GroupPoints->PushButton2->setPixmap(image2);
|
||||
|
||||
GroupDimensions = new DlgRef_3Spin1Check(this, "GroupDimensions");
|
||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
|
||||
GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
|
||||
GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
|
||||
GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
|
||||
GroupDimensions->CheckBox1->setText(tr("GEOM_REVERSE_VECTOR"));
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
Layout1->addWidget(GroupDimensions, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_VectorDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_VectorDlg::~BasicGUI_VectorDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myConstructorId = 0;
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myDx = 0.0;
|
||||
myDy = 0.0;
|
||||
myDz = 200.0;
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(0.0, 0.0, 0.0);
|
||||
myOkPoint1 = myOkPoint2 = false;
|
||||
|
||||
/* Vertices Filter for all arguments */
|
||||
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||
step = St.toDouble();
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||
|
||||
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||
|
||||
GroupDimensions->CheckBox1->setChecked(FALSE);
|
||||
|
||||
/* 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(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
|
||||
|
||||
connect(GroupDimensions->CheckBox1, SIGNAL(stateChanged(int)), this, SLOT(ReverseVector(int)));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupDimensions->hide();
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose : Radio button management
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ConstructorsClicked(int constructorId)
|
||||
{
|
||||
myConstructorId = constructorId;
|
||||
mySelection->ClearFilters();
|
||||
myGeomBase->EraseSimulationShape();
|
||||
disconnect(mySelection, 0, this, 0);
|
||||
myOkPoint1 = myOkPoint2 = false;
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
GroupDimensions->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints->show();
|
||||
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
GroupPoints->LineEdit1->setText("");
|
||||
GroupPoints->LineEdit2->setText("");
|
||||
|
||||
/* filter for next selection */
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
GroupPoints->hide();
|
||||
resize( 0, 0 );
|
||||
GroupDimensions->show();
|
||||
|
||||
myDx = 0.0;
|
||||
myDy = 0.0;
|
||||
myDz = 200.0;
|
||||
|
||||
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0) ;
|
||||
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||
|
||||
GroupDimensions->CheckBox1->setChecked(FALSE);
|
||||
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
/* Add arrow in simulation */
|
||||
bool noNeedToTest = AddArrowToSimulation(mySimulationTopoDs);
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
switch(myConstructorId)
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
if(myOkPoint1 && myOkPoint2)
|
||||
myBasicGUI->MakeVectorAndDisplay(myPoint1, myPoint2);
|
||||
break ;
|
||||
}
|
||||
case 1 :
|
||||
{
|
||||
/* Recup args and call method */
|
||||
myDx = GroupDimensions->SpinBox_DX->GetValue();
|
||||
myDy = GroupDimensions->SpinBox_DY->GetValue();
|
||||
myDz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||
myBasicGUI->MakeVectorAndDisplay(myPoint1, myPoint2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if (nbSel != 1) {
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint1 = false;
|
||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkPoint2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomBase->VertexToPoint(S, myPoint2)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint2 = true;
|
||||
}
|
||||
|
||||
if(myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion()) {
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
/* Add arrow in simulation */
|
||||
bool noNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs);
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::SetEditCurrentArgument()
|
||||
{
|
||||
if(myConstructorId != 0)
|
||||
return;
|
||||
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
}
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if (send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
if(myConstructorId == 0)
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
if(!mySimulationTopoDs.IsNull())
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ValueChangedInSpinBox(double newValue)
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
QObject* send = (QObject*)sender();
|
||||
|
||||
if(send == GroupDimensions->SpinBox_DX)
|
||||
myDx = newValue;
|
||||
else if (send == GroupDimensions->SpinBox_DY)
|
||||
myDy = newValue;
|
||||
else if (send == GroupDimensions->SpinBox_DZ)
|
||||
myDz = newValue;
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||
|
||||
if(myPoint1.Distance(myPoint2) > Precision::Confusion()) { // mySimulationTopoDs
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
/* Create simulation vector with an arrow */
|
||||
this->AddArrowToSimulation(mySimulationTopoDs);
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : AddArrowToSimulation()
|
||||
// purpose : An arrow (cone topology) is added to 'modifiedShape'
|
||||
// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'.
|
||||
// : If an arrow can't be added returns false and 'modifiedShape' isn't modified !
|
||||
//=================================================================================
|
||||
bool BasicGUI_VectorDlg::AddArrowToSimulation(TopoDS_Shape& modifiedShape)
|
||||
{
|
||||
TopoDS_Shape arrow;
|
||||
/* Try to add a cone simulation shape to show direction of a linear edge */
|
||||
if(myGeomBase->CreateArrowForLinearEdge(modifiedShape, arrow)) {
|
||||
TopoDS_Compound Comp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound (Comp);
|
||||
B.Add(Comp, modifiedShape);
|
||||
B.Add(Comp, arrow);
|
||||
modifiedShape = Comp;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ReverseVector()
|
||||
// purpose : 'state' not used here
|
||||
//=================================================================================
|
||||
void BasicGUI_VectorDlg::ReverseVector(int state)
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
myDx = -myDx;
|
||||
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||
myDy = -myDy;
|
||||
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||
myDz = -myDz;
|
||||
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||
|
||||
/* In the appropriate constructor */
|
||||
if(myPoint1.Distance(myPoint2) > Precision::Confusion()) {
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
/* Add arrow in simulation */
|
||||
bool noNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs);
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
return;
|
||||
}
|
86
src/BasicGUI/BasicGUI_VectorDlg.h
Normal file
@ -0,0 +1,86 @@
|
||||
// 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 : BasicGUI_VectorDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_VECTOR_H
|
||||
#define DIALOGBOX_VECTOR_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
#include "DlgRef_3Spin1Check.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_VectorDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_VectorDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_VectorDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BasicGUI_VectorDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
bool AddArrowToSimulation(TopoDS_Shape& modifiedShape);
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
double step;
|
||||
int myConstructorId;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint1; /* Points containing the vector */
|
||||
gp_Pnt myPoint2;
|
||||
bool myOkPoint1; /* Are true when myPoint is defined */
|
||||
bool myOkPoint2;
|
||||
double myDx;
|
||||
double myDy;
|
||||
double myDz;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupPoints;
|
||||
DlgRef_3Spin1Check* GroupDimensions;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ConstructorsClicked(int constructorId);
|
||||
void ValueChangedInSpinBox(double newValue);
|
||||
void ReverseVector(int state);
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_VECTOR_H
|
217
src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx
Normal file
@ -0,0 +1,217 @@
|
||||
// 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 : BasicGUI_WorkingPlaneDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
|
||||
using namespace std;
|
||||
#include "BasicGUI_WorkingPlaneDlg.h"
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_WorkingPlaneDlg()
|
||||
// purpose : Constructs a BasicGUI_WorkingPlaneDlg 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.
|
||||
//=================================================================================
|
||||
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_WPLANE_FACE")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_WPLANE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_WPLANE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupWPlane = new DlgRef_1Sel_QTD(this, "GroupWPlane");
|
||||
GroupWPlane->GroupBox1->setTitle(tr("GEOM_WPLANE_FACE"));
|
||||
GroupWPlane->TextLabel1->setText(tr("GEOM_SELECTION"));
|
||||
GroupWPlane->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupWPlane, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBasicGUI = theBasicGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_WorkingPlaneDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BasicGUI_WorkingPlaneDlg::~BasicGUI_WorkingPlaneDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupWPlane->LineEdit1;
|
||||
|
||||
myOkPlane = false;
|
||||
|
||||
/* Filter definition */
|
||||
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||
mySelection->AddFilter(myFaceFilter); /* filter for next selection */
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupWPlane->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupWPlane->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupWPlane->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if(myOkPlane)
|
||||
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
myOkPlane = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
BRepAdaptor_Surface surf(TopoDS::Face(S));
|
||||
gp_Pln Plane = surf.Plane();
|
||||
myLoc = Plane.Location();
|
||||
myDir = Plane.Axis().Direction();
|
||||
|
||||
GroupWPlane->LineEdit1->setText(aString);
|
||||
myOkPlane = true;
|
||||
|
||||
/* no simulation */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::SetEditCurrentArgument()
|
||||
{
|
||||
GroupWPlane->LineEdit1->setFocus();
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::LineEditReturnPressed()
|
||||
{
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_WorkingPlaneDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
74
src/BasicGUI/BasicGUI_WorkingPlaneDlg.h
Normal file
@ -0,0 +1,74 @@
|
||||
// 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 : BasicGUI_WorkingPlaneDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
|
||||
#ifndef DIALOGBOX_WORKINGPLANE_H
|
||||
#define DIALOGBOX_WORKINGPLANE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel_QTD.h"
|
||||
|
||||
#include "BasicGUI.h"
|
||||
|
||||
#include "GEOM_FaceFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_WorkingPlaneDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_WorkingPlaneDlg( QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||
~BasicGUI_WorkingPlaneDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BasicGUI* myBasicGUI;
|
||||
|
||||
Handle(GEOM_FaceFilter) myFaceFilter; /* filter for selection */
|
||||
|
||||
gp_Pnt myLoc;
|
||||
gp_Dir myDir;
|
||||
bool myOkPlane; /* to check when arguments are defined */
|
||||
|
||||
DlgRef_1Sel_QTD* GroupWPlane;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_WORKINGPLANE_H
|
75
src/BasicGUI/Makefile.in
Normal file
@ -0,0 +1,75 @@
|
||||
# GEOM BASICGUI :
|
||||
#
|
||||
# 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@
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= BasicGUI_PointDlg.h
|
||||
|
||||
# Libraries targets
|
||||
LIB = libBasicGUI.la
|
||||
|
||||
LIB_SRC = BasicGUI.cxx \
|
||||
BasicGUI_PointDlg.cxx \
|
||||
BasicGUI_LineDlg.cxx \
|
||||
BasicGUI_CircleDlg.cxx \
|
||||
BasicGUI_EllipseDlg.cxx \
|
||||
BasicGUI_ArcDlg.cxx \
|
||||
BasicGUI_VectorDlg.cxx \
|
||||
BasicGUI_PlaneDlg.cxx \
|
||||
BasicGUI_WorkingPlaneDlg.cxx
|
||||
|
||||
LIB_MOC = \
|
||||
BasicGUI.h \
|
||||
BasicGUI_PointDlg.h \
|
||||
BasicGUI_LineDlg.h \
|
||||
BasicGUI_CircleDlg.h \
|
||||
BasicGUI_EllipseDlg.h \
|
||||
BasicGUI_ArcDlg.h \
|
||||
BasicGUI_VectorDlg.h \
|
||||
BasicGUI_PlaneDlg.h \
|
||||
BasicGUI_WorkingPlaneDlg.h
|
||||
|
||||
LIB_CLIENT_IDL =
|
||||
|
||||
LIB_SERVER_IDL =
|
||||
|
||||
# additionnal information to compil and link file
|
||||
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||
|
||||
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||
|
||||
@CONCLUDE@
|
138
src/BooleanGUI/BooleanGUI.cxx
Normal file
@ -0,0 +1,138 @@
|
||||
// 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 : BooleanGUI.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
using namespace std;
|
||||
#include "BooleanGUI.h"
|
||||
|
||||
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
||||
|
||||
#include "BooleanGUI_FuseDlg.h" // Method FUSE
|
||||
#include "BooleanGUI_CommonDlg.h" // Method COMMON
|
||||
#include "BooleanGUI_CutDlg.h" // Method CUT
|
||||
#include "BooleanGUI_SectionDlg.h" // Method SECTION
|
||||
|
||||
//=======================================================================
|
||||
// function : BooleanGUI()
|
||||
// purpose : Constructor
|
||||
//=======================================================================
|
||||
BooleanGUI::BooleanGUI() :
|
||||
QObject()
|
||||
{
|
||||
myGeomBase = new GEOMBase();
|
||||
myGeomGUI = GEOMContext::GetGeomGUI();
|
||||
myGeom = myGeomGUI->myComponentGeom;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ~BooleanGUI()
|
||||
// purpose : Destructor
|
||||
//=======================================================================
|
||||
BooleanGUI::~BooleanGUI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : OnGUIEvent()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
bool BooleanGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{
|
||||
BooleanGUI* myBooleanGUI = new BooleanGUI();
|
||||
myBooleanGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||
|
||||
switch (theCommandID)
|
||||
{
|
||||
case 5011: // FUSE
|
||||
{
|
||||
BooleanGUI_FuseDlg *aDlg = new BooleanGUI_FuseDlg(parent, "", myBooleanGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 5012: // COMMON
|
||||
{
|
||||
BooleanGUI_CommonDlg *aDlg = new BooleanGUI_CommonDlg(parent, "", myBooleanGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 5013: // CUT
|
||||
{
|
||||
BooleanGUI_CutDlg *aDlg = new BooleanGUI_CutDlg(parent, "", myBooleanGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 5014: // SECTION
|
||||
{
|
||||
BooleanGUI_SectionDlg *aDlg = new BooleanGUI_SectionDlg(parent, "", myBooleanGUI, Sel);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : MakeBooleanAndDisplay()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void BooleanGUI::MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_Shape_ptr Shape2, const short operation)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
|
||||
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
||||
Standard_CString type;
|
||||
myGeomBase->GetShapeTypeString(S,type);
|
||||
result->NameType(type);
|
||||
|
||||
if (myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// EXPORTED METHODS
|
||||
//=====================================================================================
|
||||
extern "C"
|
||||
{
|
||||
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{return BooleanGUI::OnGUIEvent(theCommandID, parent);}
|
||||
}
|
58
src/BooleanGUI/BooleanGUI.h
Normal file
@ -0,0 +1,58 @@
|
||||
// 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 : BooleanGUI.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef BOOLEANGUI_H
|
||||
#define BOOLEANGUI_H
|
||||
|
||||
#include "GEOMBase.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BooleanGUI : public QObject
|
||||
{
|
||||
Q_OBJECT /* for QT compatibility */
|
||||
|
||||
public :
|
||||
BooleanGUI();
|
||||
~BooleanGUI();
|
||||
|
||||
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||
|
||||
void MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1,
|
||||
GEOM::GEOM_Shape_ptr Shape2,
|
||||
const short operation);
|
||||
|
||||
GEOMBase* myGeomBase;
|
||||
GEOMContext* myGeomGUI;
|
||||
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
250
src/BooleanGUI/BooleanGUI_CommonDlg.cxx
Normal file
@ -0,0 +1,250 @@
|
||||
// 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 : BooleanGUI_CommonDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BooleanGUI_CommonDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_CommonDlg()
|
||||
// purpose : Constructs a BooleanGUI_CommonDlg 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.
|
||||
//=================================================================================
|
||||
BooleanGUI_CommonDlg::BooleanGUI_CommonDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_COMMON")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_COMMON_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_COMMON"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupCommon = new DlgRef_2Sel_QTD(this, "GroupCommon");
|
||||
GroupCommon->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupCommon->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||
GroupCommon->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||
GroupCommon->PushButton1->setPixmap(image1);
|
||||
GroupCommon->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupCommon, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBooleanGUI = theBooleanGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BooleanGUI_CommonDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BooleanGUI_CommonDlg::~BooleanGUI_CommonDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||
|
||||
myShape1.Nullify();
|
||||
myShape2.Nullify();
|
||||
myOkShape1 = myOkShape2 = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupCommon->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupCommon->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupCommon->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupCommon->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupCommon->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkShape1 && myOkShape2)
|
||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection has changed
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupCommon->LineEdit1)
|
||||
myOkShape1 = false;
|
||||
else if( myEditCurrentArgument == GroupCommon->LineEdit2)
|
||||
myOkShape2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
Standard_Boolean testResult;
|
||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupCommon->LineEdit1) {
|
||||
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape1 = S;
|
||||
GroupCommon->LineEdit1->setText(aString);
|
||||
myOkShape1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupCommon->LineEdit2) {
|
||||
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape2 = S;
|
||||
GroupCommon->LineEdit2->setText(aString);
|
||||
myOkShape2 = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupCommon->PushButton1) {
|
||||
GroupCommon->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||
}
|
||||
else if(send == GroupCommon->PushButton2) {
|
||||
GroupCommon->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupCommon->LineEdit2;
|
||||
}
|
||||
SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupCommon->LineEdit1)
|
||||
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||
else if(send == GroupCommon->LineEdit2)
|
||||
myEditCurrentArgument = GroupCommon->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void BooleanGUI_CommonDlg::enterEvent(QEvent * e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
76
src/BooleanGUI/BooleanGUI_CommonDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 : BooleanGUI_CommonDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_COMMON_H
|
||||
#define DIALOGBOX_COMMON_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BooleanGUI.h"
|
||||
|
||||
#include <BRepAlgoAPI_Common.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_CommonDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BooleanGUI_CommonDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BooleanGUI_CommonDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BooleanGUI_CommonDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent * e);
|
||||
|
||||
BooleanGUI* myBooleanGUI;
|
||||
|
||||
TopoDS_Shape myShape1; /* topology used */
|
||||
TopoDS_Shape myShape2; /* topology used */
|
||||
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||
bool myOkShape1;
|
||||
bool myOkShape2; /* to check when arguments are defined */
|
||||
|
||||
DlgRef_2Sel_QTD* GroupCommon;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_COMMON_H
|
248
src/BooleanGUI/BooleanGUI_CutDlg.cxx
Normal file
@ -0,0 +1,248 @@
|
||||
// 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 : BooleanGUI_CutDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BooleanGUI_CutDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_CutDlg()
|
||||
// purpose : Constructs a BooleanGUI_CutDlg 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.
|
||||
//=================================================================================
|
||||
BooleanGUI_CutDlg::BooleanGUI_CutDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_CUT")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_CUT_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_CUT"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut");
|
||||
GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||
GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||
GroupCut->PushButton1->setPixmap(image1);
|
||||
GroupCut->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupCut, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBooleanGUI = theBooleanGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BooleanGUI_CutDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BooleanGUI_CutDlg::~BooleanGUI_CutDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||
|
||||
myShape1.Nullify();
|
||||
myShape2.Nullify();
|
||||
myOkShape1 = myOkShape2 = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupCut->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupCut->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupCut->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupCut->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupCut->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkShape1 && myOkShape2)
|
||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection has changed
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupCut->LineEdit1)
|
||||
myOkShape1 = false;
|
||||
else if( myEditCurrentArgument == GroupCut->LineEdit2)
|
||||
myOkShape2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
Standard_Boolean testResult;
|
||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupCut->LineEdit1) {
|
||||
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape1 = S;
|
||||
GroupCut->LineEdit1->setText(aString);
|
||||
myOkShape1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupCut->LineEdit2) {
|
||||
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape2 = S;
|
||||
GroupCut->LineEdit2->setText(aString);
|
||||
myOkShape2 = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupCut->PushButton1) {
|
||||
GroupCut->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||
}
|
||||
else if(send == GroupCut->PushButton2) {
|
||||
GroupCut->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupCut->LineEdit2;
|
||||
}
|
||||
SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupCut->LineEdit1)
|
||||
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||
else if(send == GroupCut->LineEdit2)
|
||||
myEditCurrentArgument = GroupCut->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void BooleanGUI_CutDlg::enterEvent(QEvent * e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
76
src/BooleanGUI/BooleanGUI_CutDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 : BooleanGUI_CutDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_CUT_H
|
||||
#define DIALOGBOX_CUT_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BooleanGUI.h"
|
||||
|
||||
#include <BRepAlgoAPI_Cut.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_CutDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BooleanGUI_CutDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BooleanGUI_CutDlg( QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||
~BooleanGUI_CutDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BooleanGUI* myBooleanGUI;
|
||||
|
||||
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||
bool myOkShape1; /* to check when arguments are defined */
|
||||
bool myOkShape2;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupCut;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_CUT_H
|
248
src/BooleanGUI/BooleanGUI_FuseDlg.cxx
Normal file
@ -0,0 +1,248 @@
|
||||
// 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 : BooleanGUI_FuseDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BooleanGUI_FuseDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_FuseDlg()
|
||||
// purpose : Constructs a BooleanGUI_FuseDlg 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.
|
||||
//=================================================================================
|
||||
BooleanGUI_FuseDlg::BooleanGUI_FuseDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_FUSE")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_FUSE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_FUSE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupFuse = new DlgRef_2Sel_QTD(this, "GroupFuse");
|
||||
GroupFuse->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupFuse->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||
GroupFuse->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||
GroupFuse->PushButton1->setPixmap(image1);
|
||||
GroupFuse->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupFuse, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBooleanGUI = theBooleanGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BooleanGUI_FuseDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BooleanGUI_FuseDlg::~BooleanGUI_FuseDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||
|
||||
myShape1.Nullify();
|
||||
myShape2.Nullify();
|
||||
myOkShape1 = myOkShape2 = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupFuse->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupFuse->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupFuse->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupFuse->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupFuse->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkShape1 && myOkShape2)
|
||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection has changed
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupFuse->LineEdit1)
|
||||
myOkShape1 = false;
|
||||
else if( myEditCurrentArgument == GroupFuse->LineEdit2)
|
||||
myOkShape2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
Standard_Boolean testResult;
|
||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupFuse->LineEdit1) {
|
||||
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape1 = S;
|
||||
GroupFuse->LineEdit1->setText(aString);
|
||||
myOkShape1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupFuse->LineEdit2) {
|
||||
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape2 = S;
|
||||
GroupFuse->LineEdit2->setText(aString);
|
||||
myOkShape2 = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupFuse->PushButton1) {
|
||||
GroupFuse->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||
}
|
||||
else if(send == GroupFuse->PushButton2) {
|
||||
GroupFuse->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupFuse->LineEdit2;
|
||||
}
|
||||
SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupFuse->LineEdit1)
|
||||
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||
else if(send == GroupFuse->LineEdit2)
|
||||
myEditCurrentArgument = GroupFuse->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void BooleanGUI_FuseDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
76
src/BooleanGUI/BooleanGUI_FuseDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 : BooleanGUI_FuseDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_FUSE_H
|
||||
#define DIALOGBOX_FUSE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BooleanGUI.h"
|
||||
|
||||
#include <BRepAlgoAPI_Fuse.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_FuseDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BooleanGUI_FuseDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BooleanGUI_FuseDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BooleanGUI_FuseDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BooleanGUI* myBooleanGUI;
|
||||
|
||||
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||
bool myOkShape1; /* to check when arguments are defined */
|
||||
bool myOkShape2;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupFuse;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_FUSE_H
|
249
src/BooleanGUI/BooleanGUI_SectionDlg.cxx
Normal file
@ -0,0 +1,249 @@
|
||||
// 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 : BooleanGUI_SectionDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BooleanGUI_SectionDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_SectionDlg()
|
||||
// purpose : Constructs a BooleanGUI_SectionDlg 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.
|
||||
//=================================================================================
|
||||
BooleanGUI_SectionDlg::BooleanGUI_SectionDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_SECTION")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_SECTION_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_SECTION"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupSection = new DlgRef_2Sel_QTD(this, "GroupSection");
|
||||
GroupSection->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupSection->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||
GroupSection->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||
GroupSection->PushButton1->setPixmap(image1);
|
||||
GroupSection->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupSection, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisation */
|
||||
myBooleanGUI = theBooleanGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BooleanGUI_SectionDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BooleanGUI_SectionDlg::~BooleanGUI_SectionDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||
|
||||
myShape1.Nullify();
|
||||
myShape2.Nullify();
|
||||
myOkShape1 = myOkShape2 = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupSection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupSection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupSection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupSection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupSection->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkShape1 && myOkShape2)
|
||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection has changed
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupSection->LineEdit1)
|
||||
myOkShape1 = false;
|
||||
else if( myEditCurrentArgument == GroupSection->LineEdit2)
|
||||
myOkShape2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* nbSel == 1 */
|
||||
TopoDS_Shape S;
|
||||
Standard_Boolean testResult;
|
||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupSection->LineEdit1) {
|
||||
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape1 = S;
|
||||
GroupSection->LineEdit1->setText(aString);
|
||||
myOkShape1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupSection->LineEdit2) {
|
||||
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
myShape2 = S;
|
||||
GroupSection->LineEdit2->setText(aString);
|
||||
myOkShape2 = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
|
||||
if(send == GroupSection->PushButton1) {
|
||||
GroupSection->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||
}
|
||||
else if(send == GroupSection->PushButton2) {
|
||||
GroupSection->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupSection->LineEdit2;
|
||||
}
|
||||
SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupSection->LineEdit1)
|
||||
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||
else if(send == GroupSection->LineEdit2)
|
||||
myEditCurrentArgument = GroupSection->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void BooleanGUI_SectionDlg::enterEvent(QEvent * e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
76
src/BooleanGUI/BooleanGUI_SectionDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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 : BooleanGUI_SectionDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DIALOGBOX_SECTION_H
|
||||
#define DIALOGBOX_SECTION_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BooleanGUI.h"
|
||||
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_SectionDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BooleanGUI_SectionDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BooleanGUI_SectionDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BooleanGUI_SectionDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BooleanGUI* myBooleanGUI;
|
||||
|
||||
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||
bool myOkShape1; /* to check when arguments are defined */
|
||||
bool myOkShape2;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupSection;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void LineEditReturnPressed();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_SECTION_H
|
67
src/BooleanGUI/Makefile.in
Normal file
@ -0,0 +1,67 @@
|
||||
# GEOM BOOLEANGUI :
|
||||
#
|
||||
# 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@
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS=
|
||||
|
||||
# Libraries targets
|
||||
LIB = libBooleanGUI.la
|
||||
|
||||
LIB_SRC = BooleanGUI.cxx \
|
||||
BooleanGUI_FuseDlg.cxx \
|
||||
BooleanGUI_CommonDlg.cxx \
|
||||
BooleanGUI_CutDlg.cxx \
|
||||
BooleanGUI_SectionDlg.cxx
|
||||
|
||||
LIB_MOC = \
|
||||
BooleanGUI.h \
|
||||
BooleanGUI_FuseDlg.h \
|
||||
BooleanGUI_CommonDlg.h \
|
||||
BooleanGUI_CutDlg.h \
|
||||
BooleanGUI_SectionDlg.h
|
||||
|
||||
LIB_CLIENT_IDL =
|
||||
|
||||
LIB_SERVER_IDL =
|
||||
|
||||
# additionnal information to compil and link file
|
||||
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||
|
||||
LDFLAGS += -lGEOMBase
|
||||
|
||||
@CONCLUDE@
|
265
src/BuildGUI/BuildGUI.cxx
Normal file
@ -0,0 +1,265 @@
|
||||
// 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 : BooleanGUI.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI.h"
|
||||
|
||||
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
||||
|
||||
#include "BuildGUI_EdgeDlg.h" // Method EDGE
|
||||
#include "BuildGUI_WireDlg.h" // Method WIRE
|
||||
#include "BuildGUI_FaceDlg.h" // Method FACE
|
||||
#include "BuildGUI_ShellDlg.h" // Method SHELL
|
||||
#include "BuildGUI_SolidDlg.h" // Method SOLID
|
||||
#include "BuildGUI_CompoundDlg.h" // Method COMPOUND
|
||||
|
||||
//=======================================================================
|
||||
// function : BuildGUI()
|
||||
// purpose : Constructor
|
||||
//=======================================================================
|
||||
BuildGUI::BuildGUI() :
|
||||
QObject()
|
||||
{
|
||||
myGeomBase = new GEOMBase();
|
||||
myGeomGUI = GEOMContext::GetGeomGUI();
|
||||
myGeom = myGeomGUI->myComponentGeom;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : ~BuildGUI()
|
||||
// purpose : Destructor
|
||||
//=======================================================================
|
||||
BuildGUI::~BuildGUI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : OnGUIEvent()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
bool BuildGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{
|
||||
BuildGUI* myBuildGUI = new BuildGUI();
|
||||
myBuildGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||
|
||||
switch (theCommandID)
|
||||
{
|
||||
case 4081: // GEOM::EDGE
|
||||
{
|
||||
BuildGUI_EdgeDlg *aDlg = new BuildGUI_EdgeDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4082: // GEOM::WIRE
|
||||
{
|
||||
BuildGUI_WireDlg *aDlg = new BuildGUI_WireDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4083: // GEOM::FACE
|
||||
{
|
||||
BuildGUI_FaceDlg *aDlg = new BuildGUI_FaceDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4084: // GEOM::SHELL
|
||||
{
|
||||
BuildGUI_ShellDlg *aDlg = new BuildGUI_ShellDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4085: // GEOM::SOLID
|
||||
{
|
||||
BuildGUI_SolidDlg *aDlg = new BuildGUI_SolidDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
case 4086: // GEOM::COMPOUND
|
||||
{
|
||||
BuildGUI_CompoundDlg *aDlg = new BuildGUI_CompoundDlg(parent, "", myBuildGUI, Sel);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeLinearEdgeAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
||||
{
|
||||
try {
|
||||
GEOM::PointStruct ps1 = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||
GEOM::PointStruct ps2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeEdge(ps1, ps2);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_EDGE"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeWireAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeWire(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 : MakeFaceAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
if (wantPlanar)
|
||||
result->NameType(tr("GEOM_PLANE"));
|
||||
else
|
||||
result->NameType(tr("GEOM_FACE"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeShellAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeShell(listShapesIOR);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_SHELL"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeSolidAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeSolid(listShapesIOR);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_SOLID"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// function : MakeCompoundAndDisplay()
|
||||
// purpose :
|
||||
//=====================================================================================
|
||||
void BuildGUI::MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||
{
|
||||
try {
|
||||
GEOM::GEOM_Shape_var result = myGeom->MakeCompound(listShapesIOR);
|
||||
if(result->_is_nil()) {
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||
return;
|
||||
}
|
||||
result->NameType(tr("GEOM_COMPOUND"));
|
||||
if(myGeomBase->Display(result))
|
||||
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||
}
|
||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||
QtCatchCorbaException(S_ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// EXPORTED METHODS
|
||||
//=====================================================================================
|
||||
extern "C"
|
||||
{
|
||||
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
{return BuildGUI::OnGUIEvent(theCommandID, parent);}
|
||||
}
|
62
src/BuildGUI/BuildGUI.h
Normal file
@ -0,0 +1,62 @@
|
||||
// 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.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef BUILDGUI_H
|
||||
#define BUILDGUI_H
|
||||
|
||||
#include "GEOMBase.h"
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI : public QObject
|
||||
{
|
||||
Q_OBJECT /* for QT compatibility */
|
||||
|
||||
public :
|
||||
BuildGUI();
|
||||
~BuildGUI();
|
||||
|
||||
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||
|
||||
void MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2);
|
||||
void MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||
void MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar);
|
||||
void MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||
void MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||
void MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||
|
||||
GEOMBase* myGeomBase;
|
||||
GEOMContext* myGeomGUI;
|
||||
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
189
src/BuildGUI/BuildGUI_CompoundDlg.cxx
Normal file
@ -0,0 +1,189 @@
|
||||
// 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_CompoundDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_CompoundDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_CompoundDlg()
|
||||
// purpose : Constructs a BuildGUI_CompoundDlg 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_CompoundDlg::BuildGUI_CompoundDlg(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_BUILD_COMPOUND")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_COMPOUND_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_COMPOUND"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_1Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_CompoundDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_CompoundDlg::~BuildGUI_CompoundDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
myOkListShapes = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if(myOkListShapes)
|
||||
myBuildGUI->MakeCompoundAndDisplay(myListShapes);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
myOkListShapes = false;
|
||||
int nbSel = mySelection->IObjectCount();
|
||||
if(nbSel == 0)
|
||||
return;
|
||||
aString = tr("%1_objects").arg(nbSel);
|
||||
|
||||
// int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
// if(nbSel <= 1) {
|
||||
// myOkListShapes = false;
|
||||
// return;
|
||||
// }
|
||||
|
||||
myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkListShapes = true;
|
||||
/* no simulation */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::SetEditCurrentArgument()
|
||||
{
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_CompoundDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
69
src/BuildGUI/BuildGUI_CompoundDlg.h
Normal file
@ -0,0 +1,69 @@
|
||||
// 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 : GEOMBase_Context*_CompoundDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_COMPOUND_H
|
||||
#define DIALOGBOX_COMPOUND_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_CompoundDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_CompoundDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_CompoundDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_CompoundDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
|
||||
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||
bool myOkListShapes; /* to check when arguments is defined */
|
||||
|
||||
DlgRef_1Sel_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_COMPOUND_H
|
278
src/BuildGUI/BuildGUI_EdgeDlg.cxx
Normal file
@ -0,0 +1,278 @@
|
||||
// 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_EdgeDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_EdgeDlg.h"
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_EdgeDlg()
|
||||
// purpose : Constructs a BuildGUI_EdgeDlg 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_EdgeDlg::BuildGUI_EdgeDlg(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_BUILD_EDGE")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_EDGE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_EDGE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
GroupPoints->PushButton2->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_EdgeDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_EdgeDlg::~BuildGUI_EdgeDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||
myPoint2.SetCoord(0.0, 0.0, 0.0);
|
||||
myOkPoint1 = myOkPoint2 = false;
|
||||
|
||||
/* first filter used */
|
||||
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(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if (mySimulationTopoDs.IsNull())
|
||||
return;
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
if(myOkPoint1 && myOkPoint2)
|
||||
myBuildGUI->MakeLinearEdgeAndDisplay(myPoint1, myPoint2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::SelectionIntoArgument()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkPoint1 = false;
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||
myOkPoint2 = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
TopoDS_Shape S;
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||
return;
|
||||
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint1 = true;
|
||||
}
|
||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomBase->VertexToPoint(S, myPoint2)) {
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkPoint2 = true;
|
||||
}
|
||||
|
||||
if(myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion())
|
||||
this->MakeEdgeSimulationAndDisplay();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else if (send == GroupPoints->LineEdit2)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
}
|
||||
mySelection->AddFilter(myVertexFilter);
|
||||
this->SelectionIntoArgument();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::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_EdgeDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : MakeMirrorSimulationAndDisplay()
|
||||
// purpose : S1 is a shape and S2 a mirror.
|
||||
//=================================================================================
|
||||
void BuildGUI_EdgeDlg::MakeEdgeSimulationAndDisplay()
|
||||
{
|
||||
myGeomBase->EraseSimulationShape();
|
||||
mySimulationTopoDs.Nullify();
|
||||
|
||||
try {
|
||||
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
MESSAGE("Exception catched in MakeEdgeSimulationAndDisplay");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
76
src/BuildGUI/BuildGUI_EdgeDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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_EdgeDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_EDGE_H
|
||||
#define DIALOGBOX_EDGE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_EdgeDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_EdgeDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_EdgeDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_EdgeDlg();
|
||||
|
||||
private :
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
void MakeEdgeSimulationAndDisplay();
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||
|
||||
gp_Pnt myPoint1; /* Points containing the vector */
|
||||
gp_Pnt myPoint2;
|
||||
bool myOkPoint1; /* true when myPoint is defined */
|
||||
bool myOkPoint2;
|
||||
|
||||
DlgRef_2Sel_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_EDGE_H
|
219
src/BuildGUI/BuildGUI_FaceDlg.cxx
Normal file
@ -0,0 +1,219 @@
|
||||
// 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_FaceDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_FaceDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_FaceDlg()
|
||||
// purpose : Constructs a BuildGUI_FaceDlg 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_FaceDlg::BuildGUI_FaceDlg(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_BUILD_FACE")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_FACE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_FACE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_FACE_FFW"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_WIRE"));
|
||||
GroupPoints->CheckButton1->setText(tr("GEOM_FACE_OPT"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_FaceDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_FaceDlg::~BuildGUI_FaceDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
GroupPoints->CheckButton1->setChecked(TRUE);
|
||||
|
||||
myOkShape = false;
|
||||
|
||||
myWireFilter = new GEOM_ShapeTypeFilter(TopAbs_WIRE, myGeom);
|
||||
mySelection->AddFilter(myWireFilter); /* first filter used */
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if(myOkShape)
|
||||
myBuildGUI->MakeFaceAndDisplay(myGeomShape, GroupPoints->CheckButton1->isChecked());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
myOkShape = false;
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// nbSel == 1!
|
||||
Standard_Boolean testResult;
|
||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||
if(!myGeomBase->GetTopoFromSelection(mySelection, myShape))
|
||||
return;
|
||||
|
||||
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||
if(!testResult)
|
||||
return;
|
||||
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkShape = true;
|
||||
/* no simulation */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::SetEditCurrentArgument()
|
||||
{
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
mySelection->ClearFilters();
|
||||
mySelection->AddFilter(myWireFilter);
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1)
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
else
|
||||
return;
|
||||
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
mySelection->AddFilter(myWireFilter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
76
src/BuildGUI/BuildGUI_FaceDlg.h
Normal file
@ -0,0 +1,76 @@
|
||||
// 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_FaceDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_FACE_H
|
||||
#define DIALOGBOX_FACE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel1Check_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_FaceDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_FaceDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_FaceDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_FaceDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
|
||||
/* Filter selection */
|
||||
Handle(GEOM_ShapeTypeFilter) myWireFilter;
|
||||
|
||||
TopoDS_Shape myShape; /* topology used to fuse */
|
||||
GEOM::GEOM_Shape_var myGeomShape; /* is myShape */
|
||||
bool myOkShape; /* to check when arguments is defined */
|
||||
|
||||
DlgRef_1Sel1Check_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_FACE_H
|
199
src/BuildGUI/BuildGUI_ShellDlg.cxx
Normal file
@ -0,0 +1,199 @@
|
||||
// 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_ShellDlg.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_ShellDlg.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
#include "QAD_Desktop.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_ShellDlg()
|
||||
// purpose : Constructs a BuildGUI_ShellDlg 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_ShellDlg::BuildGUI_ShellDlg(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_BUILD_SHELL")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_SHELL_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_SHELL"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupShell = new DlgRef_1Sel_QTD(this, "GroupShell");
|
||||
GroupShell->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupShell->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||
GroupShell->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupShell, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_ShellDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_ShellDlg::~BuildGUI_ShellDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupShell->LineEdit1;
|
||||
myOkListShapes = false;
|
||||
|
||||
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||
/* Filter for the next selection */
|
||||
mySelection->AddFilter(myFaceFilter) ;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupShell->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupShell->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkListShapes)
|
||||
myBuildGUI->MakeShellAndDisplay(myListShapes);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
myOkListShapes = false;
|
||||
int nbSel = mySelection->IObjectCount();
|
||||
if(nbSel == 0)
|
||||
return;
|
||||
|
||||
aString = tr("%1_objects").arg(nbSel);
|
||||
|
||||
myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkListShapes = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters() ;
|
||||
GroupShell->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupShell->LineEdit1;
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
mySelection->AddFilter(myFaceFilter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_ShellDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if(GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
73
src/BuildGUI/BuildGUI_ShellDlg.h
Normal file
@ -0,0 +1,73 @@
|
||||
// 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_ShellDlg.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DIALOGBOX_SHELL_H
|
||||
#define DIALOGBOX_SHELL_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
#include "GEOM_FaceFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_ShellDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_ShellDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_ShellDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_ShellDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent * e);
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
|
||||
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
|
||||
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||
bool myOkListShapes; /* to check when arguments is defined */
|
||||
|
||||
DlgRef_1Sel_QTD* GroupShell;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_SHELL_H
|
198
src/BuildGUI/BuildGUI_SolidDlg.cxx
Normal file
@ -0,0 +1,198 @@
|
||||
// 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_SolidDlg.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_SolidDlg.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
#include "QAD_Desktop.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_SolidDlg()
|
||||
// purpose : Constructs a BuildGUI_SolidDlg 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_SolidDlg::BuildGUI_SolidDlg(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_BUILD_SOLID")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_SOLID_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_SOLID"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupSolid = new DlgRef_1Sel_QTD(this, "GroupSolid");
|
||||
GroupSolid->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
GroupSolid->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||
GroupSolid->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupSolid, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_SolidDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_SolidDlg::~BuildGUI_SolidDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupSolid->LineEdit1;
|
||||
myOkListShapes = false;
|
||||
|
||||
myShellFilter = new GEOM_ShapeTypeFilter(TopAbs_SHELL, myGeom);
|
||||
/* filter for next selection */
|
||||
mySelection->AddFilter(myShellFilter);
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect(GroupSolid->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
/* displays Dialog */
|
||||
GroupSolid->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return ;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
|
||||
if(myOkListShapes)
|
||||
myBuildGUI->MakeSolidAndDisplay(myListShapes);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = "";
|
||||
|
||||
myOkListShapes = false;
|
||||
int nbSel = mySelection->IObjectCount();
|
||||
if (nbSel == 0)
|
||||
return;
|
||||
|
||||
aString = tr("%1_objects").arg(nbSel);
|
||||
|
||||
myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkListShapes = true;
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
mySelection->ClearFilters() ;
|
||||
GroupSolid->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupSolid->LineEdit1;
|
||||
mySelection->AddFilter(myShellFilter);
|
||||
SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
mySelection->AddFilter(myShellFilter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_SolidDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
73
src/BuildGUI/BuildGUI_SolidDlg.h
Normal file
@ -0,0 +1,73 @@
|
||||
// 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_SolidDlg.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DIALOGBOX_SOLID_H
|
||||
#define DIALOGBOX_SOLID_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
#include "GEOM_ShapeTypeFilter.hxx"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_SolidDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_SolidDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_SolidDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_SolidDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent * e);
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
|
||||
Handle(GEOM_ShapeTypeFilter) myShellFilter; /* filter for selection */
|
||||
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||
bool myOkListShapes; /* to check when arguments is defined */
|
||||
|
||||
DlgRef_1Sel_QTD* GroupSolid;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void SetEditCurrentArgument();
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void ActivateThisDialog();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_SOLID_H
|
183
src/BuildGUI/BuildGUI_WireDlg.cxx
Normal file
@ -0,0 +1,183 @@
|
||||
// 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_WireDlg.cxx
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
using namespace std;
|
||||
#include "BuildGUI_WireDlg.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_WireDlg()
|
||||
// purpose : Constructs a BuildGUI_WireDlg 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_WireDlg::BuildGUI_WireDlg(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_BUILD_WIRE")));
|
||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_WIRE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
GroupConstructors->setTitle(tr("GEOM_WIRE"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
GroupPoints = new DlgRef_1Sel_QTD(this, "GroupPoints");
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_WIRE_CONNECT"));
|
||||
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||
GroupPoints->PushButton1->setPixmap(image1);
|
||||
|
||||
Layout1->addWidget(GroupPoints, 1, 0);
|
||||
/***************************************************************/
|
||||
|
||||
/* Initialisations */
|
||||
myBuildGUI = theBuildGUI;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BuildGUI_WireDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
BuildGUI_WireDlg::~BuildGUI_WireDlg()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
myOkListShapes = false;
|
||||
|
||||
/* signals and slots connections */
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
|
||||
/* displays Dialog */
|
||||
GroupPoints->show();
|
||||
this->show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::ClickOnOk()
|
||||
{
|
||||
this->ClickOnApply();
|
||||
ClickOnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::ClickOnApply()
|
||||
{
|
||||
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||
if(myOkListShapes)
|
||||
myBuildGUI->MakeWireAndDisplay(myListShapes);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::SelectionIntoArgument()
|
||||
{
|
||||
myEditCurrentArgument->setText("");
|
||||
QString aString = ""; /* name of selection */
|
||||
|
||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||
if(nbSel < 1) {
|
||||
myOkListShapes = false;
|
||||
return;
|
||||
}
|
||||
|
||||
myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||
myEditCurrentArgument->setText(aString);
|
||||
myOkListShapes = true;
|
||||
/* no simulation */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::SetEditCurrentArgument()
|
||||
{
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
this->SelectionIntoArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_WireDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if (GroupConstructors->isEnabled())
|
||||
return;
|
||||
this->ActivateThisDialog();
|
||||
return;
|
||||
}
|
69
src/BuildGUI/BuildGUI_WireDlg.h
Normal file
@ -0,0 +1,69 @@
|
||||
// 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_WireDlg.h
|
||||
// Author : Lucien PIGNOLONI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#ifndef DIALOGBOX_WIRE_H
|
||||
#define DIALOGBOX_WIRE_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_1Sel_QTD.h"
|
||||
|
||||
#include "BuildGUI.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : BuildGUI_WireDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class BuildGUI_WireDlg : public GEOMBase_Skeleton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildGUI_WireDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~BuildGUI_WireDlg();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
|
||||
BuildGUI* myBuildGUI;
|
||||
|
||||
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||
bool myOkListShapes; /* to check when arguments is defined */
|
||||
|
||||
DlgRef_1Sel_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnApply();
|
||||
void ActivateThisDialog();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
||||
};
|
||||
|
||||
#endif // DIALOGBOX_WIRE_H
|
71
src/BuildGUI/Makefile.in
Normal file
@ -0,0 +1,71 @@
|
||||
# GEOM BUILDGUI :
|
||||
#
|
||||
# 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@
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS=
|
||||
|
||||
# Libraries targets
|
||||
LIB = libBuildGUI.la
|
||||
|
||||
LIB_SRC = BuildGUI.cxx \
|
||||
BuildGUI_EdgeDlg.cxx \
|
||||
BuildGUI_WireDlg.cxx \
|
||||
BuildGUI_FaceDlg.cxx \
|
||||
BuildGUI_ShellDlg.cxx \
|
||||
BuildGUI_SolidDlg.cxx \
|
||||
BuildGUI_CompoundDlg.cxx
|
||||
|
||||
LIB_MOC = \
|
||||
BuildGUI.h \
|
||||
BuildGUI_EdgeDlg.h \
|
||||
BuildGUI_WireDlg.h \
|
||||
BuildGUI_FaceDlg.h \
|
||||
BuildGUI_ShellDlg.h \
|
||||
BuildGUI_SolidDlg.h \
|
||||
BuildGUI_CompoundDlg.h
|
||||
|
||||
LIB_CLIENT_IDL =
|
||||
|
||||
LIB_SERVER_IDL =
|
||||
|
||||
# additionnal information to compil and link file
|
||||
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||
|
||||
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||
|
||||
@CONCLUDE@
|
1007
src/DisplayGUI/DisplayGUI.cxx
Normal file
66
src/DisplayGUI/DisplayGUI.h
Normal file
@ -0,0 +1,66 @@
|
||||
// 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 : DisplayGUI.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DISPLAYGUI_H
|
||||
#define DISPLAYGUI_H
|
||||
|
||||
#include "GEOMBase.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : GEOMBase_Display
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class DisplayGUI : public QObject
|
||||
{
|
||||
Q_OBJECT /* for QT compatibility */
|
||||
|
||||
public :
|
||||
DisplayGUI();
|
||||
~DisplayGUI();
|
||||
|
||||
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||
static void BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO);
|
||||
|
||||
void OnDisplayAll(bool onlyPreviousDisplayedObject = false);
|
||||
void OnVTKDisplayOnly();
|
||||
void OnDisplayOnly();
|
||||
void OnErase();
|
||||
|
||||
/* Method opening context for any sub shape selection */
|
||||
bool PrepareSubShapeSelection(const int SubShapeType, Standard_Integer& returnLocalContextId);
|
||||
/* Method opening context for sub shape selection on an argument shape */
|
||||
bool PrepareSubShapeSelectionArgumentShape(const TopoDS_Shape& aShape, const int SubShapeType,
|
||||
Standard_Integer& returnLocalContextId);
|
||||
|
||||
GEOMBase* myGeomBase;
|
||||
GEOMContext* myGeomGUI;
|
||||
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
59
src/DisplayGUI/Makefile.in
Normal file
@ -0,0 +1,59 @@
|
||||
# GEOM DISPLAYGUI :
|
||||
#
|
||||
# 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 = libDisplayGUI.la
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= DisplayGUI.h
|
||||
|
||||
LIB_SRC = DisplayGUI.cxx
|
||||
|
||||
LIB_MOC = \
|
||||
DisplayGUI.h
|
||||
|
||||
LIB_CLIENT_IDL = SALOME_Exception.idl
|
||||
|
||||
LIB_SERVER_IDL =
|
||||
|
||||
# additionnal information to compil and link file
|
||||
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||
|
||||
LDFLAGS += -lGEOMBase
|
||||
|
||||
@CONCLUDE@
|
91
src/DlgRef/DlgRef_1Sel1Check1List_QTD.cxx
Normal file
@ -0,0 +1,91 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel1Check1List_QTD.ui'
|
||||
**
|
||||
** Created: lun oct 27 16:18:55 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel1Check1List_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Check1List_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel1Check1List_QTD::DlgRef_1Sel1Check1List_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel1Check1List_QTD" );
|
||||
resize( 129, 104 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel1Check1List_QTD" ) );
|
||||
DlgRef_1Sel1Check1List_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Check1List_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 166, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 2 );
|
||||
|
||||
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||
CheckButton1->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton1, 2, 2, 0, 2 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( TextLabel2, 1, 1, 0, 1 );
|
||||
|
||||
ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
|
||||
ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout1->addWidget( ComboBox1, 1, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel1Check1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Check1List_QTD::~DlgRef_1Sel1Check1List_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
47
src/DlgRef/DlgRef_1Sel1Check1List_QTD.h
Normal file
@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel1Check1List_QTD.ui'
|
||||
**
|
||||
** Created: lun oct 27 16:18:55 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL1CHECK1LIST_QTD_H
|
||||
#define DLGREF_1SEL1CHECK1LIST_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QComboBox;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
|
||||
class DlgRef_1Sel1Check1List_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Check1List_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel1Check1List_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QRadioButton* CheckButton1;
|
||||
QLabel* TextLabel2;
|
||||
QComboBox* ComboBox1;
|
||||
QLineEdit* LineEdit1;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel1Check1List_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1CHECK1LIST_QTD_H
|
79
src/DlgRef/DlgRef_1Sel1Check_QTD.cxx
Normal file
@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel1Check_QTD.ui'
|
||||
**
|
||||
** Created: ven oct 10 11:28:38 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel1Check_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Check_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel1Check_QTD::DlgRef_1Sel1Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel1Check_QTD" );
|
||||
resize( 129, 76 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel1Check_QTD" ) );
|
||||
DlgRef_1Sel1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Check_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
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 = new QSpacerItem( 0, 113, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 2, 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 );
|
||||
|
||||
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||
CheckButton1->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton1, 1, 1, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Check_QTD::~DlgRef_1Sel1Check_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
44
src/DlgRef/DlgRef_1Sel1Check_QTD.h
Normal file
@ -0,0 +1,44 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel1Check_QTD.ui'
|
||||
**
|
||||
** Created: ven oct 10 11:28:37 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL1CHECK_QTD_H
|
||||
#define DLGREF_1SEL1CHECK_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
|
||||
class DlgRef_1Sel1Check_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel1Check_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QLineEdit* LineEdit1;
|
||||
QRadioButton* CheckButton1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel1Check_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1CHECK_QTD_H
|
54
src/DlgRef/DlgRef_1Sel1Spin.cxx
Normal file
@ -0,0 +1,54 @@
|
||||
// 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 : DlgRef_1Sel1Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel1Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel1Spin::DlgRef_1Sel1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel1Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
47
src/DlgRef/DlgRef_1Sel1Spin.h
Normal file
@ -0,0 +1,47 @@
|
||||
// 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 : DlgRef_1Sel1Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL1SPIN_H
|
||||
#define DLGREF_1SEL1SPIN_H
|
||||
|
||||
#include "DlgRef_1Sel1Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel1Spin : public DlgRef_1Sel1Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel1Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1SPIN_H
|
54
src/DlgRef/DlgRef_1Sel1Spin1Check.cxx
Normal file
@ -0,0 +1,54 @@
|
||||
// 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 : DlgRef_1Sel1Spin1Check.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel1Spin1Check.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel1Spin1Check_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
47
src/DlgRef/DlgRef_1Sel1Spin1Check.h
Normal file
@ -0,0 +1,47 @@
|
||||
// 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 : DlgRef_1Sel1Spin1Check.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL1SPIN1CHECK_H
|
||||
#define DLGREF_1SEL1SPIN1CHECK_H
|
||||
|
||||
#include "DlgRef_1Sel1Spin1Check_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel1Spin1Check : public DlgRef_1Sel1Spin1Check_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Spin1Check(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||
~DlgRef_1Sel1Spin1Check();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1SPIN1CHECK_H
|
95
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.cxx
Normal file
@ -0,0 +1,95 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel1Spin1Check_QTD.ui'
|
||||
**
|
||||
** Created: lun nov 17 14:16:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel1Spin1Check_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Spin1Check_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel1Spin1Check_QTD::DlgRef_1Sel1Spin1Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel1Spin1Check_QTD" );
|
||||
resize( 129, 106 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel1Spin1Check_QTD" ) );
|
||||
DlgRef_1Sel1Spin1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Spin1Check_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 120, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 2 );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||
CheckButton1->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton1, 2, 2, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel1Spin1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Spin1Check_QTD::~DlgRef_1Sel1Spin1Check_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
48
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.h
Normal file
@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel1Spin1Check_QTD.ui'
|
||||
**
|
||||
** Created: lun nov 17 14:16:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL1SPIN1CHECK_QTD_H
|
||||
#define DLGREF_1SEL1SPIN1CHECK_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel1Spin1Check_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Spin1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel1Spin1Check_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel2;
|
||||
QLineEdit* LineEdit1;
|
||||
QRadioButton* CheckButton1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel1Spin1Check_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1SPIN1CHECK_QTD_H
|
89
src/DlgRef/DlgRef_1Sel1Spin_QTD.cxx
Normal file
@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel1Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:08 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel1Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel1Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel1Spin_QTD::DlgRef_1Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel1Spin_QTD" );
|
||||
resize( 129, 87 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel1Spin_QTD" ) );
|
||||
DlgRef_1Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 2, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel1Spin_QTD::~DlgRef_1Sel1Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
46
src/DlgRef/DlgRef_1Sel1Spin_QTD.h
Normal file
@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel1Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:08 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL1SPIN_QTD_H
|
||||
#define DLGREF_1SEL1SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel1Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel1Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QPushButton* PushButton1;
|
||||
QLabel* TextLabel1;
|
||||
QLineEdit* LineEdit1;
|
||||
QLabel* TextLabel2;
|
||||
QSpinBox* SpinBox1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel1Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL1SPIN_QTD_H
|
60
src/DlgRef/DlgRef_1Sel2Spin.cxx
Normal file
@ -0,0 +1,60 @@
|
||||
// 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 : DlgRef_1Sel2Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel2Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel2Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel2Spin::DlgRef_1Sel2Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel2Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox2->close(TRUE);
|
||||
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
|
||||
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||
Layout2->addWidget(SpinBox_DY, 1, 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
48
src/DlgRef/DlgRef_1Sel2Spin.h
Normal file
@ -0,0 +1,48 @@
|
||||
// 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 : DlgRef_1Sel2Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL2SPIN_H
|
||||
#define DLGREF_1SEL2SPIN_H
|
||||
|
||||
#include "DlgRef_1Sel2Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel2Spin : public DlgRef_1Sel2Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||
~DlgRef_1Sel2Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
DlgRef_SpinBox* SpinBox_DY;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL2SPIN_H
|
100
src/DlgRef/DlgRef_1Sel2Spin_QTD.cxx
Normal file
@ -0,0 +1,100 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel2Spin_QTD.ui'
|
||||
**
|
||||
** Created: jeu oct 2 11:08:05 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel2Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel2Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel2Spin_QTD::DlgRef_1Sel2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel2Spin_QTD" );
|
||||
resize( 129, 115 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel2Spin_QTD" ) );
|
||||
DlgRef_1Sel2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel2Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel3, 1, 0 );
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox2, 1, 1 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 30, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 2, 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 );
|
||||
|
||||
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 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel2Spin_QTD::~DlgRef_1Sel2Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
48
src/DlgRef/DlgRef_1Sel2Spin_QTD.h
Normal file
@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel2Spin_QTD.ui'
|
||||
**
|
||||
** Created: jeu oct 2 11:08:05 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL2SPIN_QTD_H
|
||||
#define DLGREF_1SEL2SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel2Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel2Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel3;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel2;
|
||||
QSpinBox* SpinBox2;
|
||||
QLineEdit* LineEdit1;
|
||||
QPushButton* PushButton1;
|
||||
QLabel* TextLabel1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel2Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL2SPIN_QTD_H
|
89
src/DlgRef/DlgRef_1Sel3Check_QTD.cxx
Normal file
@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel3Check_QTD.ui'
|
||||
**
|
||||
** Created: lun nov 17 11:32:21 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel3Check_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel3Check_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel3Check_QTD::DlgRef_1Sel3Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel3Check_QTD" );
|
||||
resize( 129, 114 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel3Check_QTD" ) );
|
||||
DlgRef_1Sel3Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel3Check_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
CheckButton2 = new QRadioButton( GroupBox1, "CheckButton2" );
|
||||
CheckButton2->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton2, 2, 2, 0, 2 );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 4, 2 );
|
||||
|
||||
CheckButton3 = new QRadioButton( GroupBox1, "CheckButton3" );
|
||||
CheckButton3->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton3, 3, 3, 0, 2 );
|
||||
|
||||
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||
CheckButton1->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addMultiCellWidget( CheckButton1, 1, 1, 0, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel3Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel3Check_QTD::~DlgRef_1Sel3Check_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
46
src/DlgRef/DlgRef_1Sel3Check_QTD.h
Normal file
@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel3Check_QTD.ui'
|
||||
**
|
||||
** Created: lun nov 17 11:32:20 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL3CHECK_QTD_H
|
||||
#define DLGREF_1SEL3CHECK_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
|
||||
class DlgRef_1Sel3Check_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel3Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel3Check_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QRadioButton* CheckButton2;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QRadioButton* CheckButton3;
|
||||
QRadioButton* CheckButton1;
|
||||
QLineEdit* LineEdit1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel3Check_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL3CHECK_QTD_H
|
63
src/DlgRef/DlgRef_1Sel3Spin.cxx
Normal file
@ -0,0 +1,63 @@
|
||||
// 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 : DlgRef_1Sel3Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel3Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel3Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel3Spin::DlgRef_1Sel3Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel3Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox2->close(TRUE);
|
||||
SpinBox3->close(TRUE);
|
||||
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
|
||||
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||
Layout2->addWidget(SpinBox_DY, 1, 1);
|
||||
|
||||
SpinBox_DZ = new DlgRef_SpinBox( GroupBox1, "SpinBox_DZ");
|
||||
Layout2->addWidget(SpinBox_DZ, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
49
src/DlgRef/DlgRef_1Sel3Spin.h
Normal file
@ -0,0 +1,49 @@
|
||||
// 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 : DlgRef_1Sel3Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL3SPIN_H
|
||||
#define DLGREF_1SEL3SPIN_H
|
||||
|
||||
#include "DlgRef_1Sel3Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel3Spin : public DlgRef_1Sel3Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel3Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||
~DlgRef_1Sel3Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
DlgRef_SpinBox* SpinBox_DY;
|
||||
DlgRef_SpinBox* SpinBox_DZ;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL3SPIN_H
|
111
src/DlgRef/DlgRef_1Sel3Spin_QTD.cxx
Normal file
@ -0,0 +1,111 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel3Spin_QTD.ui'
|
||||
**
|
||||
** Created: ven oct 24 15:55:11 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel3Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel3Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel3Spin_QTD::DlgRef_1Sel3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel3Spin_QTD" );
|
||||
resize( 129, 143 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel3Spin_QTD" ) );
|
||||
DlgRef_1Sel3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel3Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 150, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 2, 2 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->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" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel3, 1, 0 );
|
||||
|
||||
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox3, 2, 1 );
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel4, 2, 0 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel3Spin_QTD::~DlgRef_1Sel3Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
50
src/DlgRef/DlgRef_1Sel3Spin_QTD.h
Normal file
@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel3Spin_QTD.ui'
|
||||
**
|
||||
** Created: ven oct 24 15:55:10 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL3SPIN_QTD_H
|
||||
#define DLGREF_1SEL3SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel3Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel3Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QLineEdit* LineEdit1;
|
||||
QSpinBox* SpinBox2;
|
||||
QLabel* TextLabel3;
|
||||
QSpinBox* SpinBox3;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel4;
|
||||
QLabel* TextLabel2;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel3Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL3SPIN_QTD_H
|
67
src/DlgRef/DlgRef_1Sel4Spin.cxx
Normal file
@ -0,0 +1,67 @@
|
||||
// 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 : DlgRef_1Sel4Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel4Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel4Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel4Spin::DlgRef_1Sel4Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel4Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox2->close(TRUE);
|
||||
SpinBox3->close(TRUE);
|
||||
SpinBox4->close(TRUE);
|
||||
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout3->addWidget(SpinBox_DX, 0, 2);
|
||||
|
||||
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||
Layout3->addWidget(SpinBox_DY, 0, 4);
|
||||
|
||||
SpinBox_DZ = new DlgRef_SpinBox( GroupBox1, "SpinBox_DZ");
|
||||
Layout3->addWidget(SpinBox_DZ, 0, 6);
|
||||
|
||||
SpinBox_S = new DlgRef_SpinBox( GroupBox1, "SpinBox_S");
|
||||
Layout4->addWidget(SpinBox_S, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel4Spin::~DlgRef_1Sel4Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
51
src/DlgRef/DlgRef_1Sel4Spin.h
Normal file
@ -0,0 +1,51 @@
|
||||
// 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 : DlgRef_1Sel4Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL4SPIN_H
|
||||
#define DLGREF_1SEL4SPIN_H
|
||||
|
||||
#include "DlgRef_1Sel4Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel4Spin : public DlgRef_1Sel4Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel4Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
DlgRef_SpinBox* SpinBox_DY;
|
||||
DlgRef_SpinBox* SpinBox_DZ;
|
||||
|
||||
DlgRef_SpinBox* SpinBox_S;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL4SPIN_H
|
132
src/DlgRef/DlgRef_1Sel4Spin_QTD.cxx
Normal file
@ -0,0 +1,132 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel4Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel4Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel4Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel4Spin_QTD::DlgRef_1Sel4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel4Spin_QTD" );
|
||||
resize( 284, 119 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel4Spin_QTD" ) );
|
||||
DlgRef_1Sel4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel4Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
|
||||
|
||||
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel5->setText( trUtf8( "TL5" ) );
|
||||
|
||||
Layout3->addWidget( TextLabel5, 0, 5 );
|
||||
|
||||
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||
|
||||
Layout3->addWidget( TextLabel3, 0, 1 );
|
||||
|
||||
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||
|
||||
Layout3->addWidget( TextLabel4, 0, 3 );
|
||||
|
||||
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout3->addWidget( SpinBox3, 0, 6 );
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout3->addWidget( SpinBox1, 0, 2 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout3->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout3->addWidget( SpinBox2, 0, 4 );
|
||||
|
||||
Layout1->addLayout( Layout3, 1, 0 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 0 );
|
||||
|
||||
Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
|
||||
|
||||
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
|
||||
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel6->setText( trUtf8( "TL6" ) );
|
||||
|
||||
Layout4->addWidget( TextLabel6, 0, 0 );
|
||||
|
||||
SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
|
||||
|
||||
Layout4->addWidget( SpinBox4, 0, 1 );
|
||||
|
||||
Layout1->addLayout( Layout4, 2, 0 );
|
||||
|
||||
Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
|
||||
|
||||
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel1->setText( trUtf8( "TL1" ) );
|
||||
Layout2->addWidget( TextLabel1 );
|
||||
|
||||
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||
PushButton1->setText( trUtf8( "" ) );
|
||||
Layout2->addWidget( PushButton1 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
Layout2->addWidget( LineEdit1 );
|
||||
|
||||
Layout1->addLayout( Layout2, 0, 0 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel4Spin_QTD::~DlgRef_1Sel4Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
55
src/DlgRef/DlgRef_1Sel4Spin_QTD.h
Normal file
@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel4Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL4SPIN_QTD_H
|
||||
#define DLGREF_1SEL4SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel4Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel4Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel5;
|
||||
QLabel* TextLabel3;
|
||||
QLabel* TextLabel4;
|
||||
QSpinBox* SpinBox3;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel2;
|
||||
QSpinBox* SpinBox2;
|
||||
QLabel* TextLabel6;
|
||||
QSpinBox* SpinBox4;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QLineEdit* LineEdit1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel4Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout3;
|
||||
QGridLayout* Layout4;
|
||||
QHBoxLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL4SPIN_QTD_H
|
71
src/DlgRef/DlgRef_1Sel5Spin.cxx
Normal file
@ -0,0 +1,71 @@
|
||||
// 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 : DlgRef_1Sel5Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Sel5Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel5Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Sel5Spin::DlgRef_1Sel5Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_1Sel5Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox2->close(TRUE);
|
||||
SpinBox3->close(TRUE);
|
||||
SpinBox4->close(TRUE);
|
||||
SpinBox5->close(TRUE);
|
||||
|
||||
SpinBox_1 = new DlgRef_SpinBox(GroupBox1, "SpinBox_1");
|
||||
Layout2->addWidget(SpinBox_1, 0, 1);
|
||||
|
||||
SpinBox_2 = new DlgRef_SpinBox(GroupBox1, "SpinBox_2");
|
||||
Layout2->addWidget(SpinBox_2, 0, 3);
|
||||
|
||||
SpinBox_3 = new DlgRef_SpinBox(GroupBox1, "SpinBox_3");
|
||||
Layout2->addWidget(SpinBox_3, 2, 1);
|
||||
|
||||
SpinBox_4 = new DlgRef_SpinBox(GroupBox1, "SpinBox_4");
|
||||
Layout2->addWidget(SpinBox_4, 1, 1);
|
||||
|
||||
SpinBox_5 = new DlgRef_SpinBox(GroupBox1, "SpinBox_5");
|
||||
Layout2->addWidget(SpinBox_5, 1, 3);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel5Spin::~DlgRef_1Sel5Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
51
src/DlgRef/DlgRef_1Sel5Spin.h
Normal file
@ -0,0 +1,51 @@
|
||||
// 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 : DlgRef_1Sel5Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SEL5SPIN_H
|
||||
#define DLGREF_1SEL5SPIN_H
|
||||
|
||||
#include "DlgRef_1Sel5Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Sel5Spin : public DlgRef_1Sel5Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel5Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel5Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_1;
|
||||
DlgRef_SpinBox* SpinBox_2;
|
||||
DlgRef_SpinBox* SpinBox_3;
|
||||
DlgRef_SpinBox* SpinBox_4;
|
||||
DlgRef_SpinBox* SpinBox_5;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL5SPIN_H
|
133
src/DlgRef/DlgRef_1Sel5Spin_QTD.cxx
Normal file
@ -0,0 +1,133 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel5Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar nov 18 11:19:14 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_1Sel5Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Sel5Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel5Spin_QTD::DlgRef_1Sel5Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel5Spin_QTD" );
|
||||
resize( 162, 143 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel5Spin_QTD" ) );
|
||||
DlgRef_1Sel5Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel5Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox2, 0, 3 );
|
||||
|
||||
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox3, 2, 1 );
|
||||
|
||||
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel5->setText( trUtf8( "TL5" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel5, 1, 0 );
|
||||
|
||||
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel3, 0, 2 );
|
||||
|
||||
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel4, 2, 0 );
|
||||
|
||||
SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
|
||||
SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox4, 1, 1 );
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
|
||||
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel6->setText( trUtf8( "TL6" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel6, 1, 2 );
|
||||
|
||||
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||
|
||||
SpinBox5 = new QSpinBox( GroupBox1, "SpinBox5" );
|
||||
SpinBox5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox5->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox5, 1, 3 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 120, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 2, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel5Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel5Spin_QTD::~DlgRef_1Sel5Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
54
src/DlgRef/DlgRef_1Sel5Spin_QTD.h
Normal file
@ -0,0 +1,54 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel5Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar nov 18 11:19:13 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL5SPIN_QTD_H
|
||||
#define DLGREF_1SEL5SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Sel5Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel5Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel5Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLabel* TextLabel1;
|
||||
QPushButton* PushButton1;
|
||||
QSpinBox* SpinBox2;
|
||||
QSpinBox* SpinBox3;
|
||||
QLabel* TextLabel5;
|
||||
QLabel* TextLabel3;
|
||||
QLabel* TextLabel4;
|
||||
QSpinBox* SpinBox4;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel6;
|
||||
QLabel* TextLabel2;
|
||||
QSpinBox* SpinBox5;
|
||||
QLineEdit* LineEdit1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel5Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL5SPIN_QTD_H
|
74
src/DlgRef/DlgRef_1Sel_QTD.cxx
Normal file
@ -0,0 +1,74 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Sel_QTD.ui'
|
||||
**
|
||||
** Created: lun sep 22 17:38:06 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_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 DlgRef_1Sel_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Sel_QTD::DlgRef_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Sel_QTD" );
|
||||
resize( 129, 57 );
|
||||
setCaption( trUtf8( "DlgRef_1Sel_QTD" ) );
|
||||
DlgRef_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
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 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 1, 2 );
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
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 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Sel_QTD::~DlgRef_1Sel_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
42
src/DlgRef/DlgRef_1Sel_QTD.h
Normal file
@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Sel_QTD.ui'
|
||||
**
|
||||
** Created: lun sep 22 17:38:05 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SEL_QTD_H
|
||||
#define DLGREF_1SEL_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
|
||||
class DlgRef_1Sel_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Sel_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QPushButton* PushButton1;
|
||||
QLineEdit* LineEdit1;
|
||||
QLabel* TextLabel1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Sel_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SEL_QTD_H
|
56
src/DlgRef/DlgRef_1Spin.cxx
Normal file
@ -0,0 +1,56 @@
|
||||
// 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 : DlgRef_1Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_1Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_1Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_1Spin::DlgRef_1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_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
|
||||
*/
|
||||
DlgRef_1Spin::~DlgRef_1Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
47
src/DlgRef/DlgRef_1Spin.h
Normal file
@ -0,0 +1,47 @@
|
||||
// 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 : DlgRef_1Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_1SPIN_H
|
||||
#define DLGREF_1SPIN_H
|
||||
|
||||
#include "DlgRef_1Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_1Spin : public DlgRef_1Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||
~DlgRef_1Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SPIN_H
|
68
src/DlgRef/DlgRef_1Spin_QTD.cxx
Normal file
@ -0,0 +1,68 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_1Spin_QTD.ui'
|
||||
**
|
||||
** Created: jeu sep 25 12:22:29 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_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 DlgRef_1Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_1Spin_QTD::DlgRef_1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_1Spin_QTD" );
|
||||
resize( 124, 55 );
|
||||
setCaption( trUtf8( "DlgRef_1Spin_QTD" ) );
|
||||
DlgRef_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 1 );
|
||||
|
||||
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 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_1Spin_QTD::~DlgRef_1Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
40
src/DlgRef/DlgRef_1Spin_QTD.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_1Spin_QTD.ui'
|
||||
**
|
||||
** Created: jeu sep 25 12:22:29 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_1SPIN_QTD_H
|
||||
#define DLGREF_1SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_1Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_1Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel1;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_1Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_1SPIN_QTD_H
|
54
src/DlgRef/DlgRef_2Sel1Spin.cxx
Normal file
@ -0,0 +1,54 @@
|
||||
// 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 : DlgRef_2Sel1Spin.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_2Sel1Spin.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_2Sel1Spin::DlgRef_2Sel1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_2Sel1Spin_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
47
src/DlgRef/DlgRef_2Sel1Spin.h
Normal file
@ -0,0 +1,47 @@
|
||||
// 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 : DlgRef_2Sel1Spin.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_2SEL1SPIN_H
|
||||
#define DLGREF_2SEL1SPIN_H
|
||||
|
||||
#include "DlgRef_2Sel1Spin_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_2Sel1Spin : public DlgRef_2Sel1Spin_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_2Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_2Sel1Spin();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_2SEL1SPIN_H
|
54
src/DlgRef/DlgRef_2Sel1Spin1Check.cxx
Normal file
@ -0,0 +1,54 @@
|
||||
// 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 : DlgRef_2Sel1Spin1Check.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#include "DlgRef_2Sel1Spin1Check.h"
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*/
|
||||
DlgRef_2Sel1Spin1Check::DlgRef_2Sel1Spin1Check(QWidget* parent, const char* name, WFlags fl)
|
||||
:DlgRef_2Sel1Spin1Check_QTD(parent, name, fl)
|
||||
{
|
||||
SpinBox1->close(TRUE);
|
||||
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_2Sel1Spin1Check::~DlgRef_2Sel1Spin1Check()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
47
src/DlgRef/DlgRef_2Sel1Spin1Check.h
Normal file
@ -0,0 +1,47 @@
|
||||
// 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 : DlgRef_2Sel1Spin1Check.h
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
|
||||
#ifndef DLGREF_2SEL1SPIN1CHECK_H
|
||||
#define DLGREF_2SEL1SPIN1CHECK_H
|
||||
|
||||
#include "DlgRef_2Sel1Spin1Check_QTD.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
class DlgRef_2Sel1Spin1Check : public DlgRef_2Sel1Spin1Check_QTD
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_2Sel1Spin1Check(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||
~DlgRef_2Sel1Spin1Check();
|
||||
|
||||
DlgRef_SpinBox* SpinBox_DX;
|
||||
|
||||
};
|
||||
|
||||
#endif // DLGREF_2SEL1SPIN1CHECK_H
|
111
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.cxx
Normal file
@ -0,0 +1,111 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_2Sel1Spin1Check_QTD.ui'
|
||||
**
|
||||
** Created: mer oct 1 16:20:02 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_2Sel1Spin1Check_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_2Sel1Spin1Check_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_2Sel1Spin1Check_QTD::DlgRef_2Sel1Spin1Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_2Sel1Spin1Check_QTD" );
|
||||
resize( 129, 117 );
|
||||
setCaption( trUtf8( "DlgRef_2Sel1Spin1Check_QTD" ) );
|
||||
DlgRef_2Sel1Spin1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1Spin1Check_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||
|
||||
Layout1->addWidget( LineEdit2, 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 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 2 );
|
||||
|
||||
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||
PushButton2->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addWidget( PushButton2, 1, 1 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||
CheckButton1->setText( trUtf8( "" ) );
|
||||
|
||||
Layout2->addWidget( CheckButton1, 0, 2 );
|
||||
|
||||
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_2Sel1Spin1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_2Sel1Spin1Check_QTD::~DlgRef_2Sel1Spin1Check_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
51
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.h
Normal file
@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_2Sel1Spin1Check_QTD.ui'
|
||||
**
|
||||
** Created: mer oct 1 16:20:02 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_2SEL1SPIN1CHECK_QTD_H
|
||||
#define DLGREF_2SEL1SPIN1CHECK_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_2Sel1Spin1Check_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_2Sel1Spin1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_2Sel1Spin1Check_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLineEdit* LineEdit1;
|
||||
QLabel* TextLabel1;
|
||||
QLabel* TextLabel2;
|
||||
QLineEdit* LineEdit2;
|
||||
QPushButton* PushButton1;
|
||||
QPushButton* PushButton2;
|
||||
QSpinBox* SpinBox1;
|
||||
QRadioButton* CheckButton1;
|
||||
QLabel* TextLabel3;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_2Sel1Spin1Check_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_2SEL1SPIN1CHECK_QTD_H
|
105
src/DlgRef/DlgRef_2Sel1Spin_QTD.cxx
Normal file
@ -0,0 +1,105 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_2Sel1Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_2Sel1Spin_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_2Sel1Spin_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_2Sel1Spin_QTD::DlgRef_2Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_2Sel1Spin_QTD" );
|
||||
resize( 129, 117 );
|
||||
setCaption( trUtf8( "DlgRef_2Sel1Spin_QTD" ) );
|
||||
DlgRef_2Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1Spin_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||
|
||||
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||
PushButton2->setText( trUtf8( "" ) );
|
||||
|
||||
Layout1->addWidget( PushButton2, 1, 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 );
|
||||
|
||||
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||
|
||||
Layout1->addWidget( LineEdit2, 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 );
|
||||
|
||||
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 );
|
||||
|
||||
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||
|
||||
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||
|
||||
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||
|
||||
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||
|
||||
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 3, 2 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_2Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_2Sel1Spin_QTD::~DlgRef_2Sel1Spin_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
49
src/DlgRef/DlgRef_2Sel1Spin_QTD.h
Normal file
@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_2Sel1Spin_QTD.ui'
|
||||
**
|
||||
** Created: mar sep 23 16:05:09 2003
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_2SEL1SPIN_QTD_H
|
||||
#define DLGREF_2SEL1SPIN_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
||||
class DlgRef_2Sel1Spin_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_2Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_2Sel1Spin_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLineEdit* LineEdit1;
|
||||
QPushButton* PushButton2;
|
||||
QLabel* TextLabel1;
|
||||
QLineEdit* LineEdit2;
|
||||
QPushButton* PushButton1;
|
||||
QLabel* TextLabel2;
|
||||
QSpinBox* SpinBox1;
|
||||
QLabel* TextLabel3;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_2Sel1Spin_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
QGridLayout* Layout2;
|
||||
};
|
||||
|
||||
#endif // DLGREF_2SEL1SPIN_QTD_H
|