- the type of the marker used to represent vertices.
- the size of the marker.
myShadingColor = SalomeApp_Tools::color( col );
myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0);
+ myTypeOfMarker = (Aspect_TypeOfMarker)resMgr->integerValue("Geometry", "type_of_marker", 0);
+ myScaleOfMarker = resMgr->doubleValue("Geometry", "marker_scale", 1.);
+ if(myScaleOfMarker < 1.)
+ myScaleOfMarker = 1.;
+ if(myScaleOfMarker > 8.)
+ myScaleOfMarker = 8.;
+
myColor = -1;
// This color is used for shape displaying. If it is equal -1 then
Quantity_Color aColor = SalomeApp_Tools::color( col );
int anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1);
int aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1);
-
+
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetNumber( anUIsoNumber );
anAspect->SetColor( aColor );
AISShape->Attributes()->SetUIsoAspect( anAspect );
-
+
anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetNumber( aVIsoNumber );
anAspect->SetColor( aColor );
AISShape->Attributes()->SetVIsoAspect( anAspect );
-
+
if ( HasColor() )
{
AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
{
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( (Quantity_NameOfColor)GetColor() );
+ anAspect->SetScale( myScaleOfMarker );
+ anAspect->SetTypeOfMarker( myTypeOfMarker );
AISShape->Attributes()->SetPointAspect( anAspect );
}
}
{
col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
-
+
Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
anAspect->SetColor( aColor );
- AISShape->Attributes()->SetPointAspect( anAspect );
+ anAspect->SetScale( myScaleOfMarker );
+ anAspect->SetTypeOfMarker( myTypeOfMarker );
+ AISShape->Attributes()->SetPointAspect( anAspect );
}
else
{
// Set line aspect
col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
-
+
Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetLineAspect( anAspect );
// Set free boundaries aspect
col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
aColor = SalomeApp_Tools::color( col );
-
+
anAspect = AISShape->Attributes()->FreeBoundaryAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
-
+
// Set wire aspect
col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
aColor = SalomeApp_Tools::color( col );
-
+
anAspect = AISShape->Attributes()->WireAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetWireAspect( anAspect );
// 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,
+// 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
+// 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
-//
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
#include <TopoDS_Shape.hxx>
#include <Quantity_Color.hxx>
#include <LightApp_Displayer.h>
+#include <Aspect_TypeOfMarker.hxx>
#include <list>
class GEOMGUI_WNT_EXPORT GEOM_Displayer : public LightApp_Displayer
{
-
+
public:
/* Constructor */
GEOM_Displayer( SalomeApp_Study* app );
// This overloaded Display() method can be useful for operations
// not using dialog boxes.
- void Display ( GEOM::GEOM_Object_ptr theObj,
+ void Display ( GEOM::GEOM_Object_ptr theObj,
const bool updateViewer = true );
-
+
void Redisplay ( const Handle(SALOME_InteractiveObject)& theIO,
const bool updateViewer = true );
void Erase ( GEOM::GEOM_Object_ptr theObj,
const bool forced = false,
- const bool updateViewer = true );
+ const bool updateViewer = true );
/* Display/Erase list of objects methods */
-
+
void Display ( const SALOME_ListIO& theIOList,
const bool updateViewer = true );
-
+
void Erase ( const SALOME_ListIO& theIOList,
const bool forced = false,
const bool updateViewer = true );
-
+
void Redisplay ( const SALOME_ListIO& theIOList,
const bool updateViewer = true );
/* internal methods */
/* Builds presentation accordint to the current viewer type */
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
-
+
/* Sets interactive object */
void setIO( const Handle(SALOME_InteractiveObject)& theIO );
-
+
/* Sets shape */
void setShape( const TopoDS_Shape& theShape );
-
+
/* Resets internal data */
void internalReset();
void clearTemporary( LightApp_SelectionMgr* theSelMgr );
SUIT_SelectionFilter* getFilter( const int theMode );
-
+
protected:
Handle(SALOME_InteractiveObject) myIO;
TopoDS_Shape myShape;
double myWidth;
bool myToActivate;
int myDisplayMode;
+ Aspect_TypeOfMarker myTypeOfMarker;
+ double myScaleOfMarker;
private:
SalomeApp_Application* myApp;
msgid "PREF_GROUP_GENERAL"
msgstr "General"
+msgid "PREF_GROUP_VERTEX"
+msgstr "Marker of Points"
+
msgid "PREF_SHADING_COLOR"
msgstr "Default shading color"
msgid "PREF_TAB_SETTINGS"
msgstr "Settings"
+msgid "PREF_TYPE_OF_MARKER"
+msgstr "Type"
+
+msgid "PREF_MARKER_SCALE"
+msgstr "Size"
+
+msgid "TOM_POINT"
+msgstr "."
+
+msgid "TOM_PLUS"
+msgstr "+"
+
+msgid "TOM_STAR"
+msgstr "*"
+
+msgid "TOM_O"
+msgstr "O"
+
+msgid "TOM_X"
+msgstr "X"
+
+msgid "TOM_O_POINT"
+msgstr ". in O"
+
+msgid "TOM_O_PLUS"
+msgstr "+ in O"
+
+msgid "TOM_O_STAR"
+msgstr "* in O"
+
+msgid "TOM_O_X"
+msgstr "X in O"
+
msgid "ERROR_SHAPE_TYPE"
msgstr "Object of incorrect type selected!\nPlease, select face, shell or solid and try again"
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
+#include <Aspect_TypeOfMarker.hxx>
#include <OSD_SharedLibrary.hxx>
#include <utilities.h>
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
+ int VertexGroup = addPreference( tr( "PREF_GROUP_VERTEX" ), tabId );
+
+ int typeOfMarker = addPreference( tr( "PREF_TYPE_OF_MARKER" ), VertexGroup,
+ LightApp_Preferences::Selector, "Geometry", "type_of_marker" );
+
+ int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), VertexGroup,
+ LightApp_Preferences::IntSpin, "Geometry", "marker_scale" );
+
// Set property for default display mode
QStringList aModesList;
aModesList.append( tr("MEN_WIREFRAME") );
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
+ // Set property for type of vertex marker
+ QStringList aTypeOfMarkerList;
+ aTypeOfMarkerList.append( tr("TOM_POINT") );
+ aTypeOfMarkerList.append( tr("TOM_PLUS") );
+ aTypeOfMarkerList.append( tr("TOM_STAR") );
+ aTypeOfMarkerList.append( tr("TOM_O") );
+ aTypeOfMarkerList.append( tr("TOM_X") );
+ aTypeOfMarkerList.append( tr("TOM_O_POINT") );
+ aTypeOfMarkerList.append( tr("TOM_O_PLUS") );
+ aTypeOfMarkerList.append( tr("TOM_O_STAR") );
+ aTypeOfMarkerList.append( tr("TOM_O_X") );
+
+ QValueList<QVariant> anTypeOfMarkerIndexesList;
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_POINT);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_PLUS);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_STAR);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_X);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_POINT);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_PLUS);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_STAR);
+ anTypeOfMarkerIndexesList.append(Aspect_TOM_O_X);
+
+ setPreferenceProperty( typeOfMarker, "strings", aTypeOfMarkerList );
+ setPreferenceProperty( typeOfMarker, "indexes", anTypeOfMarkerIndexesList );
+
+ // Set property for Vertex Marker scale
+ setPreferenceProperty( markerScale, "min", 0.25 );
+ setPreferenceProperty( markerScale, "max", 10. );
+ setPreferenceProperty( markerScale, "precision", 1 );
+
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )