#include "HYDROData_Tool.h"
#include "HYDROData_GeomTool.h"
+#ifdef WIN32
+ #pragma warning ( disable: 4251 )
+#endif
+
+#ifndef LIGHT_MODE
#include <Basics_Utils.hxx>
+#endif
+
+#ifdef WIN32
+ #pragma warning ( default: 4251 )
+#endif
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
#include <TopExp_Explorer.hxx>
+#ifdef WIN32
+ #pragma warning ( disable: 4251 )
+#endif
+
#include <QColor>
#include <QFile>
#include <QFileInfo>
#include <QStringList>
+#ifdef WIN32
+ #pragma warning ( default: 4251 )
+#endif
+
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic
#include <HYDROData_Projection.h>
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject)
HYDROData_Obstacle::HYDROData_Obstacle()
-: HYDROData_ArtificialObject()
+: HYDROData_ArtificialObject( Geom_3d )
{
}
{
}
-QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+QStringList HYDROData_Obstacle::DumpToPython( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
if ( !aGeomObjectEntry.IsEmpty() )
{
QString aSalomeObjName = HYDROData_Tool::GenerateNameForPython( theTreatedObjects, "obstacle_sobj" );
- // aResList << QString( "%1 = theStudy.FindObjectID( \"%2\" );" )
+ // aResList << QString( "%1 = theStudy.FindObjectID( \"%2\" )" )
// .arg( aSalomeObjName ).arg( aGeomObjectEntry.ToCString() );
QString aGeomObjectName( GetGeomObjectName().ToCString() );
if ( !aGeomObjectName.isEmpty() ) {
aResList << QString( "%1 = theStudy.FindObjectByName( \"%2\", \"GEOM\" )[0];" )
.arg( aSalomeObjName ).arg( aGeomObjectName );
- aResList << QString( "%1.ImportFromGeomIOR( %2.GetIOR() );" )
+ aResList << QString( "%1.ImportFromGeomIOR( %2.GetIOR() )" )
.arg( anObstacleName ).arg( aSalomeObjName );
- aResList << QString( "%1.SetGeomObjectEntry( %2.GetID() );" )
+ aResList << QString( "%1.SetGeomObjectEntry( %2.GetID() )" )
.arg( anObstacleName ).arg( aSalomeObjName );
}
aResList << QString( "" );
}
else if ( !aFilePath.isEmpty() )
{
- aResList << QString( "%1.ImportFromFile( \"%2\" );" )
+ aResList << QString( "%1.ImportFromFile( \"%2\" )" )
.arg( anObstacleName ).arg( aFilePath );
aResList << QString( "" );
}
double aDx, aDy, aDz;
if ( getTranslation( aDx, aDy, aDz ) )
{
- aResList << QString( "%1.Translate( %2, %3, %4 );" )
+ aResList << QString( "%1.Translate( %2, %3, %4 )" )
.arg( anObstacleName ).arg( aDx ).arg( aDy ).arg( aDz );
aResList << QString( "" );
}
- aResList << QString( "%1.Update();" ).arg( anObstacleName );
+ aResList << QString( "%1.Update()" ).arg( anObstacleName );
aResList << QString( "" );
return aResList;
void HYDROData_Obstacle::Update()
{
- removeGroupObjects();
+ RemoveGroupObjects();
createGroupObjects();
checkAndSetAltitudeObject();
return true;
}
-TopoDS_Shape HYDROData_Obstacle::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Obstacle::GetShape3D() const
-{
- return getShape3D();
-}
-
void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape )
{
TopoDS_Face aShape2d = HYDROData_Projection::MakeProjection( theShape );
HYDROData_ArtificialObject::SetTopShape( aShape2d );
}
-QColor HYDROData_Obstacle::DefaultFillingColor()
+QColor HYDROData_Obstacle::DefaultFillingColor() const
{
return QColor( Qt::yellow );
}
-QColor HYDROData_Obstacle::DefaultBorderColor()
+QColor HYDROData_Obstacle::DefaultBorderColor() const
{
return QColor( Qt::transparent );
}
{
bool aRes = false;
+#ifndef LIGHT_MODE
if ( theIOR.IsEmpty() ) {
return aRes;
}
SetShape3D( aShape );
aRes = true;
}
-
+#endif
+
return aRes;
}
return aRes;
}
+#ifndef LIGHT_MODE
SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( aDocId );
if ( !aDSStudy->_is_nil() ) {
aRes = TCollection_AsciiString( aSObject->GetName() );
}
}
-
+#endif
return aRes;
}
{
TopoDS_Shape aResShape;
+#ifndef LIGHT_MODE
// Set "C" numeric locale to save numbers correctly
Kernel_Utils::Localizer loc;
catch(Standard_Failure) {
aResShape.Nullify();
}
+#endif
return aResShape;
}
{
TopoDS_Shape aResShape;
+#ifndef LIGHT_MODE
// Set "C" numeric locale to save numbers correctly
Kernel_Utils::Localizer loc;
catch (Standard_Failure) {
aResShape.Nullify();
}
+#endif
return aResShape;
}
-QColor HYDROData_Obstacle::getDefaultFillingColor() const
-{
- return DefaultFillingColor();
-}
-
-QColor HYDROData_Obstacle::getDefaultBorderColor() const
-{
- return DefaultBorderColor();
-}
-
ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const
{
DEBTRACE("HYDROData_Obstacle::getAltitudeObjectType");