ADD_SUBDIRECTORY (src/ConstructionPlugin)
ADD_SUBDIRECTORY (src/BuildPlugin)
ADD_SUBDIRECTORY (src/PrimitivesPlugin)
+ADD_SUBDIRECTORY (src/GDMLPlugin)
ADD_SUBDIRECTORY (src/FeaturesPlugin)
ADD_SUBDIRECTORY (src/CollectionPlugin)
ADD_SUBDIRECTORY (src/SamplePanelPlugin)
ADD_SUBDIRECTORY (src/PartSetAPI)
ADD_SUBDIRECTORY (src/PrimitivesAPI)
ADD_SUBDIRECTORY (src/SketchAPI)
+ADD_SUBDIRECTORY (src/GDMLAPI)
IF(${HAVE_SALOME})
ADD_SUBDIRECTORY (src/SHAPERGUI)
<plugin library="ConstructionPlugin" configuration="plugin-Construction.xml"/>
<plugin library="BuildPlugin" configuration="plugin-Build.xml"/>
<plugin library="PrimitivesPlugin" configuration="plugin-Primitives.xml"/>
+ <plugin library="GDMLPlugin" configuration="plugin-GDML.xml"/>
<plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
<plugin library="CollectionPlugin" configuration="plugin-Collection.xml"/>
<plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
GeomAlgoAPI_XAOExport.h
GeomAlgoAPI_XAOImport.h
GeomAlgoAPI_Copy.h
+ GeomAlgoAPI_ConeSegment.h
)
SET(PROJECT_SOURCES
GeomAlgoAPI_XAOExport.cpp
GeomAlgoAPI_XAOImport.cpp
GeomAlgoAPI_Copy.cpp
+ GeomAlgoAPI_ConeSegment.cpp
)
SET(PROJECT_LIBRARIES
INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
ADD_UNIT_TESTS(TestAPI_Box.py
+ TestAPI_GDMLConeSegment.py
TestAPI_Translation.py)
%shared_ptr(GeomAlgoAPI_Translation)
%shared_ptr(GeomAlgoAPI_Transform)
%shared_ptr(GeomAlgoAPI_Box)
+%shared_ptr(GeomAlgoAPI_ConeSegment)
%shared_ptr(GeomAlgoAPI_Copy)
// all supported interfaces
// Created: 17 Mar 2016
// Author: Clarisse Genrault (CEA)
-#ifndef GeomAlgoAPI_Box_H_
-#define GeomAlgoAPI_Box_H_
+#ifndef GEOMALGOAPI_BOX_H_
+#define GEOMALGOAPI_BOX_H_
#include <GeomAPI_Pnt.h>
#include <GeomAlgoAPI_MakeShape.h>
};
-#endif
+#endif // GEOMALGOAPI_BOX_H_
// Author: Clarisse Genrault (CEA)
#include "GeomAlgoAPI_ShapeAPI.h"
+
#include <GeomAlgoAPI_Box.h>
+#include <GeomAlgoAPI_ConeSegment.h>
+#include <GeomAlgoAPI_EdgeBuilder.h>
#include <GeomAlgoAPI_Translation.h>
#include <GeomAPI_Pnt.h>
#include <GeomAPI_Edge.h>
-#include <GeomAlgoAPI_EdgeBuilder.h>
-#include <iostream>
+//#include <iostream>
namespace GeomAlgoAPI_ShapeAPI
{
}
return aTranslationAlgo.shape();
}
+
+ //=========================================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeConeSegment(
+ const double theRMin1, const double theRMax1,
+ const double theRMin2, const double theRMax2,
+ const double theZ,
+ const double theStartPhi, const double theDeltaPhi) throw (GeomAlgoAPI_Exception)
+ {
+ GeomAlgoAPI_ConeSegment aConeSegmentAlgo(theRMin1, theRMax1, theRMin2, theRMax2,
+ theZ, theStartPhi, theDeltaPhi);
+
+ if (!aConeSegmentAlgo.check()) {
+ throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
+ }
+
+ aConeSegmentAlgo.build();
+
+ if(!aConeSegmentAlgo.isDone()) {
+ throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
+ }
+ if (!aConeSegmentAlgo.checkValid("Cone Segment builder")) {
+ throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
+ }
+ return aConeSegmentAlgo.shape();
+ }
}
std::shared_ptr<GeomAPI_Shape> theSourceShape,
std::shared_ptr<GeomAPI_Pnt> theStartPoint,
std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception);
+
+ /// Creates a cone segment using standard GDML parameters
+ /// \param theRMin1 Inner radius at base of cone
+ /// \param theRMax1 Outer radius at base of cone
+ /// \param theRMin2 Inner radius at top of cone
+ /// \param theRMax2 Outer radius at top of cone
+ /// \param theZ Height of cone segment
+ /// \param theStartPhi Start angle of the segment
+ /// \param theDeltaPhi Angle of the segment
+ static std::shared_ptr<GeomAPI_Shape> makeConeSegment(
+ const double theRMin1,
+ const double theRMax1,
+ const double theRMin2,
+ const double theRMax2,
+ const double theZ,
+ const double theStartPhi,
+ const double theDeltaPhi) throw (GeomAlgoAPI_Exception);
};
}
#endif
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-// File: GeomAlgoAPI_swig.h
+// File: GeomAlgoAPI_swig.h
// Created: Dec 15, 2015
// Author: Sergey POKHODENKO
+// Modified by Clarisse Genrault (CEA) : 24 Nov 2016
#ifndef SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_
#define SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_
#include "GeomAlgoAPI_Exception.h"
#include "GeomAlgoAPI_ShapeAPI.h"
#include "GeomAlgoAPI_Box.h"
+ #include "GeomAlgoAPI_ConeSegment.h"
#include "GeomAlgoAPI_Copy.h"
#include <memory>
## Copyright (C) 2014-2016 CEA/DEN, EDF R&D
INCLUDE(Common)
+INCLUDE(UnitTest)
SET(PROJECT_HEADERS
PrimitivesAPI.h
${PROJECT_SOURCE_DIR}/src/PrimitivesPlugin
)
-#TODO(spo): is ${CAS_DEFINITIONS} necessary?
ADD_DEFINITIONS(-DPRIMITIVESAPI_EXPORTS ${CAS_DEFINITIONS})
ADD_LIBRARY(PrimitivesAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
TARGET_LINK_LIBRARIES(PrimitivesAPI ${PROJECT_LIBRARIES})
SET_SOURCE_FILES_PROPERTIES(PrimitivesAPI.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(PrimitivesAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-#TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
SET(SWIG_LINK_LIBRARIES
PrimitivesAPI
ModelHighAPI
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PrimitivesAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
# Tests
-INCLUDE(UnitTest)
-
-ADD_UNIT_TESTS(
-)
-
-# ADD_SUBDIRECTORY (Test)
+ADD_UNIT_TESTS(TestBox.py)
\ No newline at end of file
#include <ModelHighAPI_swig.h>
+ #include "PrimitivesAPI.h"
#include "PrimitivesAPI_Box.h"
-
#endif // PrimitivesAPI_swig_H_
# Created: 07 Apr 2016
# Author: Clarisse genrault (CEA)
-INCLUDE(UnitTest)
-
SET(PROJECT_HEADERS
PrimitivesPlugin.h
PrimitivesPlugin_Plugin.h
INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Primitives)
-ADD_UNIT_TESTS(TestBox.py
-)
+++ /dev/null
-"""
-Test case for Primitive Box feature.
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a box with dimensions
-aSession.startOperation()
-aBox1 = model.addBox(aDocument, 10, 10, 10).result()
-aSession.finishOperation()
-assert (aBox1 is not None)
-
-# Create a first point
-aSession.startOperation()
-aFirstPoint = model.addPoint(aDocument, 0, 0, 0).result()
-aSession.finishOperation()
-
-# Create a second point
-aSession.startOperation()
-aSecondPoint = model.addPoint(aDocument, 50, 50, 50).result()
-aSession.finishOperation()
-
-# Create a box with 2 points
-aSession.startOperation()
-aBox2 = model.addBox(aDocument, aFirstPoint, aSecondPoint).result()
-aSession.finishOperation()
-assert (aBox2 is not None)
-
-# Create a box with dimensions (error)
-aSession.startOperation()
-aBox3 = model.addBox(aDocument, -10, 10, 10).result()
-aSession.finishOperation()
-assert (aBox3 is not None)
-
-# Create a box with 2 points (error)
-aSession.startOperation()
-aBox4 = model.addBox(aDocument, aFirstPoint, aFirstPoint).result()
-aSession.finishOperation()
-assert (aBox4 is not None)
-
from parameter import *
from partset import *
from primitives import *
+from gdml import *