Merge branch 'master' of git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
This commit is contained in:
@@ -212,6 +212,7 @@ MARK_AS_ADVANCED(FORCE FREECAD_LIBPACK_CHECKFILE6X FREECAD_LIBPACK_CHECKFILE7X)
|
||||
message("-- OpenCASCADE Community Edition has been found.")
|
||||
add_definitions ( -DHAVE_CONFIG_H )
|
||||
set( OCC_LIBRARIES "TKFeat;TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEP;TKSTEPBase;TKSTEPAttr;TKHLR" ) #lib list copied from FreeCAD's FindOpenCasCade.cmake
|
||||
set( OCC_OCAF_LIBRARIES "TKCAF;TKXCAF;TKLCAF;TKXDESTEP;TKXDEIGES" ) #lib list copied from FreeCAD's FindOpenCasCade.cmake
|
||||
set( OCC_INCLUDE_DIR ${OCE_INCLUDE_DIRS} )
|
||||
set( OCC_FOUND ${OCE_FOUND} )
|
||||
else() #look for OpenCASCADE
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Try to find OCC
|
||||
# Once done this will define
|
||||
#
|
||||
# OCC_FOUND - system has OCC - OpenCASCADE
|
||||
# OCC_INCLUDE_DIR - where the OCC include directory can be found
|
||||
# OCC_LIBRARY_DIR - where the OCC library directory can be found
|
||||
# OCC_LIBRARIES - Link this to use OCC
|
||||
#
|
||||
|
||||
# OCC_FOUND - system has OCC - OpenCASCADE
|
||||
# OCC_INCLUDE_DIR - where the OCC include directory can be found
|
||||
# OCC_LIBRARY_DIR - where the OCC library directory can be found
|
||||
# OCC_LIBRARIES - Link this to use OCC
|
||||
# OCC_OCAF_LIBRARIES - Link this to use OCC OCAF framework
|
||||
|
||||
|
||||
IF (WIN32)
|
||||
IF (CYGWIN OR MINGW)
|
||||
@@ -80,5 +80,12 @@ IF(OCC_LIBRARY)
|
||||
TKHLR
|
||||
TKFeat
|
||||
)
|
||||
set(OCC_OCAF_LIBRARIES
|
||||
TKCAF
|
||||
TKXCAF
|
||||
TKLCAF
|
||||
TKXDESTEP
|
||||
TKXDEIGES
|
||||
)
|
||||
ENDIF(OCC_LIBRARY)
|
||||
|
||||
|
||||
@@ -2402,6 +2402,7 @@ class _ViewProviderRectangle(_ViewProviderDraft):
|
||||
self.Object = vobj.Object
|
||||
|
||||
def onChanged(self, vp, prop):
|
||||
from pivy import coin
|
||||
if prop == "TextureImage":
|
||||
r = vp.RootNode
|
||||
if os.path.exists(vp.TextureImage):
|
||||
|
||||
@@ -105,9 +105,10 @@ projectToSVG(PyObject *self, PyObject *args)
|
||||
PyObject *pcObjDir=0;
|
||||
const char *type=0;
|
||||
float scale=1.0f;
|
||||
float tol=0.1f;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!|O!sf", &(TopoShapePy::Type), &pcObjShape,
|
||||
&(Base::VectorPy::Type), &pcObjDir, &type, &scale))
|
||||
if (!PyArg_ParseTuple(args, "O!|O!sff", &(TopoShapePy::Type), &pcObjShape,
|
||||
&(Base::VectorPy::Type), &pcObjDir, &type, &scale, &tol))
|
||||
return NULL;
|
||||
|
||||
PY_TRY {
|
||||
@@ -121,7 +122,7 @@ projectToSVG(PyObject *self, PyObject *args)
|
||||
if (type && std::string(type) == "ShowHiddenLines")
|
||||
hidden = true;
|
||||
|
||||
Py::String result(Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale));
|
||||
Py::String result(Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale, tol));
|
||||
return Py::new_reference_to(result);
|
||||
|
||||
} PY_CATCH;
|
||||
@@ -134,9 +135,10 @@ projectToDXF(PyObject *self, PyObject *args)
|
||||
PyObject *pcObjDir=0;
|
||||
const char *type=0;
|
||||
float scale=1.0f;
|
||||
float tol=0.1f;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!|O!sf", &(TopoShapePy::Type), &pcObjShape,
|
||||
&(Base::VectorPy::Type), &pcObjDir, &type, &scale))
|
||||
if (!PyArg_ParseTuple(args, "O!|O!sff", &(TopoShapePy::Type), &pcObjShape,
|
||||
&(Base::VectorPy::Type), &pcObjDir, &type, &scale, &tol))
|
||||
return NULL;
|
||||
|
||||
PY_TRY {
|
||||
@@ -150,7 +152,7 @@ projectToDXF(PyObject *self, PyObject *args)
|
||||
if (type && std::string(type) == "ShowHiddenLines")
|
||||
hidden = true;
|
||||
|
||||
Py::String result(Alg.getDXF(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale));
|
||||
Py::String result(Alg.getDXF(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale, tol));
|
||||
return Py::new_reference_to(result);
|
||||
|
||||
} PY_CATCH;
|
||||
|
||||
@@ -70,6 +70,8 @@ using namespace std;
|
||||
// FeatureViewPart
|
||||
//===========================================================================
|
||||
|
||||
App::PropertyFloatConstraint::Constraints FeatureViewPart::floatRange = {0.01f,5.0f,0.05f};
|
||||
|
||||
PROPERTY_SOURCE(Drawing::FeatureViewPart, Drawing::FeatureView)
|
||||
|
||||
|
||||
@@ -83,6 +85,8 @@ FeatureViewPart::FeatureViewPart(void)
|
||||
ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the appearance of the dashed hidden lines");
|
||||
ADD_PROPERTY_TYPE(ShowSmoothLines ,(false),group,App::Prop_None,"Control the appearance of the smooth lines");
|
||||
ADD_PROPERTY_TYPE(LineWidth,(0.35f),vgroup,App::Prop_None,"The thickness of the resulting lines");
|
||||
ADD_PROPERTY_TYPE(Tolerance,(0.05f),vgroup,App::Prop_None,"The tessellation tolerance");
|
||||
Tolerance.setConstraints(&floatRange);
|
||||
}
|
||||
|
||||
FeatureViewPart::~FeatureViewPart()
|
||||
@@ -198,7 +202,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
|
||||
ProjectionAlgos::SvgExtractionType type = ProjectionAlgos::Plain;
|
||||
if (hidden) type = (ProjectionAlgos::SvgExtractionType)(type|ProjectionAlgos::WithHidden);
|
||||
if (smooth) type = (ProjectionAlgos::SvgExtractionType)(type|ProjectionAlgos::WithSmooth);
|
||||
result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue());
|
||||
result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue());
|
||||
|
||||
result << "</g>" << endl;
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ public:
|
||||
App::PropertyBool ShowHiddenLines;
|
||||
App::PropertyBool ShowSmoothLines;
|
||||
App::PropertyFloat LineWidth;
|
||||
|
||||
App::PropertyFloatConstraint Tolerance;
|
||||
|
||||
|
||||
/** @name methods overide Feature */
|
||||
//@{
|
||||
@@ -65,6 +66,9 @@ public:
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "DrawingGui::ViewProviderDrawingView";
|
||||
}
|
||||
|
||||
private:
|
||||
static App::PropertyFloatConstraint::Constraints floatRange;
|
||||
};
|
||||
|
||||
typedef App::FeaturePythonT<FeatureViewPart> FeatureViewPartPython;
|
||||
|
||||
@@ -149,7 +149,7 @@ void ProjectionAlgos::execute(void)
|
||||
|
||||
}
|
||||
|
||||
std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale, float tolerance)
|
||||
{
|
||||
std::stringstream result;
|
||||
SVGOutput output;
|
||||
@@ -157,7 +157,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
|
||||
if (!H.IsNull() && (type & WithHidden)) {
|
||||
float width = hfactor * scale;
|
||||
BRepMesh::Mesh(H,0.1);
|
||||
BRepMesh::Mesh(H,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -172,7 +172,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!HO.IsNull() && (type & WithHidden)) {
|
||||
float width = hfactor * scale;
|
||||
BRepMesh::Mesh(HO,0.1);
|
||||
BRepMesh::Mesh(HO,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -187,7 +187,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!VO.IsNull()) {
|
||||
float width = scale;
|
||||
BRepMesh::Mesh(VO,0.1);
|
||||
BRepMesh::Mesh(VO,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -201,7 +201,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!V.IsNull()) {
|
||||
float width = scale;
|
||||
BRepMesh::Mesh(V,0.1);
|
||||
BRepMesh::Mesh(V,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -215,7 +215,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!V1.IsNull() && (type & WithSmooth)) {
|
||||
float width = scale;
|
||||
BRepMesh::Mesh(V1,0.1);
|
||||
BRepMesh::Mesh(V1,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -229,7 +229,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
|
||||
float width = hfactor * scale;
|
||||
BRepMesh::Mesh(H1,0.1);
|
||||
BRepMesh::Mesh(H1,tolerance);
|
||||
result << "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -251,7 +251,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale)
|
||||
|
||||
/* dxf output section - Dan Falck 2011/09/25 */
|
||||
|
||||
std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale, float tolerance)
|
||||
{
|
||||
std::stringstream result;
|
||||
DXFOutput output;
|
||||
@@ -264,7 +264,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
|
||||
if (!H.IsNull() && (type & WithHidden)) {
|
||||
//float width = 0.15f/scale;
|
||||
BRepMesh::Mesh(H,0.1);
|
||||
BRepMesh::Mesh(H,tolerance);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -279,7 +279,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!HO.IsNull() && (type & WithHidden)) {
|
||||
//float width = 0.15f/scale;
|
||||
BRepMesh::Mesh(HO,0.1);
|
||||
BRepMesh::Mesh(HO,tolerance);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -294,7 +294,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!VO.IsNull()) {
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(VO,0.1);
|
||||
BRepMesh::Mesh(VO,tolerance);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
||||
@@ -310,7 +310,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!V.IsNull()) {
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(V,0.1);
|
||||
BRepMesh::Mesh(V,tolerance);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -326,7 +326,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!V1.IsNull() && (type & WithSmooth)) {
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(V1,0.1);
|
||||
BRepMesh::Mesh(V1,tolerance);
|
||||
result //<< "<g"
|
||||
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
@@ -342,7 +342,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
|
||||
//float width = 0.15f/scale;
|
||||
BRepMesh::Mesh(H1,0.1);
|
||||
BRepMesh::Mesh(H1,tolerance);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
/*<< " stroke=\"rgb(0, 0, 0)\"" << endl
|
||||
@@ -359,7 +359,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
||||
}
|
||||
|
||||
|
||||
result << 0 << endl
|
||||
result << 0 << endl
|
||||
<< "ENDSEC" << endl
|
||||
<< 0 << endl
|
||||
<< "EOF";
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
WithSmooth = 2
|
||||
};
|
||||
|
||||
std::string getSVG(SvgExtractionType type, float scale);
|
||||
std::string getDXF(SvgExtractionType type, float scale);//add by Dan Falck 2011/09/25
|
||||
std::string getSVG(SvgExtractionType type, float scale, float tolerance);
|
||||
std::string getDXF(SvgExtractionType type, float scale, float tolerance);//added by Dan Falck 2011/09/25
|
||||
|
||||
|
||||
const TopoDS_Shape &Input;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
# include <Quantity_Color.hxx>
|
||||
# include <STEPCAFControl_Reader.hxx>
|
||||
# include <STEPCAFControl_Writer.hxx>
|
||||
# include <STEPControl_Writer.hxx>
|
||||
# include <IGESCAFControl_Reader.hxx>
|
||||
# include <IGESCAFControl_Writer.hxx>
|
||||
# include <IGESControl_Controller.hxx>
|
||||
@@ -55,6 +56,7 @@
|
||||
# include <TopTools_MapOfShape.hxx>
|
||||
# include <TopExp_Explorer.hxx>
|
||||
# include <TopoDS_Iterator.hxx>
|
||||
# include <APIHeaderSection_MakeHeader.hxx>
|
||||
#if OCC_VERSION_HEX >= 0x060500
|
||||
# include <TDataXtd_Shape.hxx>
|
||||
# else
|
||||
@@ -664,8 +666,21 @@ static PyObject * exporter(PyObject *self, PyObject *args)
|
||||
|
||||
Base::FileInfo file(filename);
|
||||
if (file.hasExtension("stp") || file.hasExtension("step")) {
|
||||
//Interface_Static::SetCVal("write.step.schema", "AP214IS");
|
||||
STEPCAFControl_Writer writer;
|
||||
writer.Transfer(hDoc, STEPControl_AsIs);
|
||||
|
||||
// edit STEP header
|
||||
#if OCC_VERSION_HEX >= 0x060500
|
||||
APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model());
|
||||
#else
|
||||
APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model());
|
||||
#endif
|
||||
makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)filename));
|
||||
makeHeader.SetAuthorValue (1, new TCollection_HAsciiString("FreeCAD"));
|
||||
makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString("FreeCAD"));
|
||||
makeHeader.SetOriginatingSystem(new TCollection_HAsciiString("FreeCAD"));
|
||||
makeHeader.SetDescriptionValue(1, new TCollection_HAsciiString("FreeCAD Model"));
|
||||
writer.Write(filename);
|
||||
}
|
||||
else if (file.hasExtension("igs") || file.hasExtension("iges")) {
|
||||
|
||||
@@ -95,11 +95,11 @@ void PartExport initPart()
|
||||
// see Init.py
|
||||
#if defined (_OCC64)
|
||||
#if OCC_VERSION_HEX < 0x060503
|
||||
App::GetApplication().addImportType("STEP AP203 format (*.step *.stp)","Part");
|
||||
App::GetApplication().addExportType("STEP AP203 format (*.step *.stp)","Part");
|
||||
App::GetApplication().addImportType("STEP (*.step *.stp)","Part");
|
||||
App::GetApplication().addExportType("STEP (*.step *.stp)","Part");
|
||||
#else
|
||||
App::GetApplication().addImportType("STEP AP214 format (*.step *.stp)","ImportGui");
|
||||
App::GetApplication().addExportType("STEP AP214 format (*.step *.stp)","ImportGui");
|
||||
App::GetApplication().addImportType("STEP with colors (*.step *.stp)","ImportGui");
|
||||
App::GetApplication().addExportType("STEP with colors (*.step *.stp)","ImportGui");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -446,9 +446,10 @@ CmdPartImport::CmdPartImport()
|
||||
void CmdPartImport::activated(int iMsg)
|
||||
{
|
||||
QStringList filter;
|
||||
filter << QString::fromAscii("STEP AP203 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP AP214 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP with colors (*.stp *.step)");
|
||||
filter << QString::fromAscii("IGES (*.igs *.iges)");
|
||||
filter << QString::fromAscii("IGES with colors (*.igs *.iges)");
|
||||
filter << QString::fromAscii("BREP (*.brp *.brep)");
|
||||
|
||||
QString select;
|
||||
@@ -459,7 +460,7 @@ void CmdPartImport::activated(int iMsg)
|
||||
if (!pDoc) return; // no document
|
||||
openCommand("Import Part");
|
||||
if (select == filter[1] ||
|
||||
select == filter[2]) {
|
||||
select == filter[3]) {
|
||||
doCommand(Doc, "import ImportGui");
|
||||
doCommand(Doc, "ImportGui.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName());
|
||||
}
|
||||
@@ -504,9 +505,10 @@ CmdPartExport::CmdPartExport()
|
||||
void CmdPartExport::activated(int iMsg)
|
||||
{
|
||||
QStringList filter;
|
||||
filter << QString::fromAscii("STEP AP203 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP AP214 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP with colors (*.stp *.step)");
|
||||
filter << QString::fromAscii("IGES (*.igs *.iges)");
|
||||
filter << QString::fromAscii("IGES with colors (*.igs *.iges)");
|
||||
filter << QString::fromAscii("BREP (*.brp *.brep)");
|
||||
|
||||
QString select;
|
||||
@@ -515,7 +517,7 @@ void CmdPartExport::activated(int iMsg)
|
||||
App::Document* pDoc = getDocument();
|
||||
if (!pDoc) return; // no document
|
||||
if (select == filter[1] ||
|
||||
select == filter[2]) {
|
||||
select == filter[3]) {
|
||||
Gui::Application::Instance->exportTo((const char*)fn.toUtf8(),pDoc->getName(),"ImportGui");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -54,9 +54,9 @@ FreeCAD.addExportType("IGES format (*.iges *.igs)","Part")
|
||||
# The registration of the STEP filetype for 64-bit is handled in initPart()
|
||||
import platform
|
||||
if platform.architecture()[0]=='32bit':
|
||||
FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui")
|
||||
FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui")
|
||||
FreeCAD.addImportType("STEP with colors (*.step *.stp)","ImportGui")
|
||||
FreeCAD.addExportType("STEP with colors (*.step *.stp)","ImportGui")
|
||||
#else:
|
||||
# FreeCAD.addImportType("STEP AP203 format (*.step *.stp)","Part")
|
||||
# FreeCAD.addExportType("STEP AP203 format (*.step *.stp)","Part")
|
||||
# FreeCAD.addImportType("STEP (*.step *.stp)","Part")
|
||||
# FreeCAD.addExportType("STEP (*.step *.stp)","Part")
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ SET(ShipExamples_SRCS
|
||||
Examples/s60_katamaran.fcstd
|
||||
Examples/wigley.fcstd
|
||||
Examples/wigley_katamaran.fcstd
|
||||
OpenCL/simInit.cl
|
||||
)
|
||||
SOURCE_GROUP("shipexamples" FILES ${ShipExamples_SRCS})
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ nobase_data_DATA = \
|
||||
Examples/s60_katamaran.fcstd \
|
||||
Examples/wigley.fcstd \
|
||||
Examples/wigley_katamaran.fcstd \
|
||||
OpenCL/simInit.cl \
|
||||
shipLoadExample/__init__.py \
|
||||
shipLoadExample/TaskPanel.py \
|
||||
shipLoadExample/TaskPanel.ui \
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* -----------------------------------------------------------------------
|
||||
*
|
||||
* This source file is part of AQUA-gpusph.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
|
||||
*
|
||||
*
|
||||
* Authors:
|
||||
* - Cercos Pita, Jose Luis
|
||||
* - Miguel Gonzalez, Leo
|
||||
* - Saelices, Jaime
|
||||
* - Souto Iglesias, Antonio
|
||||
*
|
||||
* -----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3,14159265359
|
||||
#endif
|
||||
|
||||
#ifdef _g
|
||||
#error '_g' is already defined.
|
||||
#endif
|
||||
#define _g __global
|
||||
|
||||
#ifdef _l
|
||||
#error '_l' is already defined.
|
||||
#endif
|
||||
#define _l __local
|
||||
|
||||
#ifdef _c
|
||||
#error '_c' is already defined.
|
||||
#endif
|
||||
#define _c __constant
|
||||
|
||||
#ifndef _grav
|
||||
#define _grav 9.81
|
||||
#endif
|
||||
|
||||
/** Setup velocity and acceleration potential for initial time step.
|
||||
* @param pos Cell position.
|
||||
* @param v Cell velocity.
|
||||
* @param f Cell acceleration.
|
||||
* @param waves Waves (A,T,phase,heading)
|
||||
* @param phi Velocity potential.
|
||||
* @param Phi Acceleration potential
|
||||
* @param N Number of cell elements at each direction.
|
||||
* @param n Number of waves.
|
||||
*/
|
||||
__kernel void FS(_g float4* pos, _g float4* v, _g float4* f,
|
||||
_g float4* waves, _g float* phi, _g float* Phi,
|
||||
uint2 N, uint n)
|
||||
{
|
||||
// find position in global arrays
|
||||
unsigned int i = get_global_id(0);
|
||||
unsigned int j = get_global_id(1);
|
||||
if( (i >= N.x) || (j >= N.y) )
|
||||
return;
|
||||
unsigned int id = i*N.y + j;
|
||||
|
||||
// ---- | ------------------------ | ----
|
||||
// ---- V ---- Your code here ---- V ----
|
||||
|
||||
unsigned int w;
|
||||
for(w=0;w<n;w++){
|
||||
float A = waves[w].x;
|
||||
float T = waves[w].y;
|
||||
float phase = waves[w].z;
|
||||
float heading = M_PI*waves[w].w/180.f;
|
||||
float lambda = 0.5f*_grav/M_PI * T*T;
|
||||
float k = 2.f*M_PI/lambda;
|
||||
float frec = 2.f*M_PI/T;
|
||||
float l = pos[id].x*cos(heading) + pos[id].y*sin(heading);
|
||||
// Position, velocity and acceleration
|
||||
float amp = A*sin(k*l + phase);
|
||||
pos[id].z = amp;
|
||||
v[id].z = -frec*amp;
|
||||
f[id].z = frec*frec*amp;
|
||||
// Potentials
|
||||
phi[id] = _grav/frec*amp;
|
||||
Phi[id] = -_grav*amp;
|
||||
}
|
||||
|
||||
// ---- A ---- Your code here ---- A ----
|
||||
// ---- | ------------------------ | ----
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -53,6 +53,7 @@
|
||||
<?include ModWeb.wxi ?>
|
||||
<?include ModArch.wxi ?>
|
||||
<?include ModOpenSCAD.wxi ?>
|
||||
<?include ModShip.wxi ?>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
||||
172
src/WindowsInstaller/ModShip.wxi
Normal file
172
src/WindowsInstaller/ModShip.wxi
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
(c) Jose Luis Cercos Pita (jlcercos@gmail.com) 2012
|
||||
|
||||
This file is part of the FreeCAD CAx development system.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License (LGPL)
|
||||
as published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
for detail see the LICENCE text file.
|
||||
|
||||
FreeCAD 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 Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with FreeCAD; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
USA
|
||||
|
||||
Jose Luis Cercos Pita 2012
|
||||
-->
|
||||
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Directory Id="ModShip" Name="Ship" FileSource="../../Mod/Ship">
|
||||
<Component Id="CompModShip" Guid="4ddaaa92-1ccc-4462-ab58-606082aa277e" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="ShipGuiPy" Name="ShipGui.py" DiskId="1" />
|
||||
<File Id="ShipInitGuiPy" Name="InitGui.py" DiskId="1" />
|
||||
<File Id="ShipInstance" Name="Instance.py" DiskId="1" />
|
||||
<File Id="ShipTankInstance" Name="TankInstance.py" DiskId="1" />
|
||||
<File Id="ShipSimInstance" Name="SimInstance.py" DiskId="1" />
|
||||
</Component>
|
||||
<Directory Id="ModShipExamples" Name="Examples" FileSource="../../Mod/Ship/Examples" >
|
||||
<Component Id="CompModShipExamples" Guid="b5f1ae58-728b-4c0a-9b09-263cd63cdfd1" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="ShipExampleS60" Name="s60.fcstd" />
|
||||
<File Id="ShipExampleS60Katamaran" Name="s60_katamaran.fcstd" />
|
||||
<File Id="ShipExampleWigley" Name="wigley.fcstd" />
|
||||
<File Id="ShipExampleWigleyKatamaran" Name="wigley_katamaran.fcstd" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModShipIcons" Name="ShipIcons" FileSource="../../Mod/Ship/Icons" >
|
||||
<Component Id="CompModShipIcons" Guid="ebdaaf8f-b975-4097-9ef8-4ed51ce24adf" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="ShipIcons01" Name="AreaCurveIco.png" />
|
||||
<File Id="ShipIcons02" Name="DataIco.png" />
|
||||
<File Id="ShipIcons03" Name="DiscretizeIco.png" />
|
||||
<File Id="ShipIcons04" Name="HydrostaticsIco.png" />
|
||||
<File Id="ShipIcons05" Name="Ico.png" />
|
||||
<File Id="ShipIcons06" Name="LoadIco.png" />
|
||||
<File Id="ShipIcons07" Name="OutlineDrawIco.png" />
|
||||
<File Id="ShipIcons08" Name="ReparametrizeIco.png" />
|
||||
<File Id="ShipIcons09" Name="SimCreateIco.png" />
|
||||
<File Id="ShipIcons10" Name="SimPostIco.png" />
|
||||
<File Id="ShipIcons11" Name="SimRunIco.png" />
|
||||
<File Id="ShipIcons12" Name="SimStopIco.png" />
|
||||
<File Id="ShipIcons13" Name="Tank.png" />
|
||||
<File Id="ShipIcons14" Name="Weight.png" />
|
||||
<File Id="ShipIcons15" Name="Ship.xpm" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipAreasCurve" Name="shipAreasCurve" FileSource="../../Mod/Ship/shipAreasCurve" >
|
||||
<Component Id="CompModshipAreasCurve" Guid="49b32e4c-d861-4968-9c5c-8191ce6fa6c4" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipAreasCurve01" Name="__init__.py" />
|
||||
<File Id="shipAreasCurve02" Name="Plot.py" />
|
||||
<File Id="shipAreasCurve03" Name="Preview.py" />
|
||||
<File Id="shipAreasCurve04" Name="TaskPanel.py" />
|
||||
<File Id="shipAreasCurve05" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipCreateShip" Name="shipCreateShip" FileSource="../../Mod/Ship/shipCreateShip" >
|
||||
<Component Id="CompModshipCreateShip" Guid="7492bfb5-96d8-4555-8cc0-682c79a779ac" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipCreateShip01" Name="__init__.py" />
|
||||
<File Id="shipCreateShip02" Name="Preview.py" />
|
||||
<File Id="shipCreateShip03" Name="TaskPanel.py" />
|
||||
<File Id="shipCreateShip04" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipHydrostatics" Name="shipHydrostatics" FileSource="../../Mod/Ship/shipHydrostatics" >
|
||||
<Component Id="CompModshipHydrostatics" Guid="c76a6ae1-8533-4382-950b-bde2733603a8" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipHydrostatics01" Name="__init__.py" />
|
||||
<File Id="shipHydrostatics02" Name="Plot.py" />
|
||||
<File Id="shipHydrostatics03" Name="TaskPanel.py" />
|
||||
<File Id="shipHydrostatics04" Name="TaskPanel.ui" />
|
||||
<File Id="shipHydrostatics05" Name="Tools.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipLoadExample" Name="shipLoadExample" FileSource="../../Mod/Ship/shipLoadExample" >
|
||||
<Component Id="CompModshipLoadExample" Guid="3c66c63a-7967-4fe7-8138-73ef98a1b233" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipLoadExample01" Name="__init__.py" />
|
||||
<File Id="shipLoadExample02" Name="TaskPanel.py" />
|
||||
<File Id="shipLoadExample03" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipOutlineDraw" Name="shipOutlineDraw" FileSource="../../Mod/Ship/shipOutlineDraw" >
|
||||
<Component Id="CompModshipOutlineDraw" Guid="a81ec2de-3620-4b33-beaa-2ef14ac642c5" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipOutlineDraw01" Name="__init__.py" />
|
||||
<File Id="shipOutlineDraw02" Name="Plot.py" />
|
||||
<File Id="shipOutlineDraw03" Name="Preview.py" />
|
||||
<File Id="shipOutlineDraw04" Name="TaskPanel.py" />
|
||||
<File Id="shipOutlineDraw05" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModshipUtils" Name="shipUtils" FileSource="../../Mod/Ship/shipUtils" >
|
||||
<Component Id="CompModshipUtils" Guid="7fca3f4d-861a-44fb-ab2e-cd256e3ba9b3" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="shipUtils01" Name="__init__.py" />
|
||||
<File Id="shipUtils02" Name="Math.py" />
|
||||
<File Id="shipUtils03" Name="Paths.py" />
|
||||
<File Id="shipUtils04" Name="Translator.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModsimCreate" Name="simCreate" FileSource="../../Mod/Ship/simCreate" >
|
||||
<Component Id="CompModsimCreate" Guid="b56debf6-3221-4bd6-9799-f1c1928878fc" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="simCreate01" Name="__init__.py" />
|
||||
<File Id="simCreate02" Name="TaskPanel.py" />
|
||||
<File Id="simCreate03" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModsimPost" Name="simPost" FileSource="../../Mod/Ship/simPost" >
|
||||
<Component Id="CompModsimPost" Guid="137caeea-fc08-49d7-ad75-29147e122617" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="simPost01" Name="__init__.py" />
|
||||
<File Id="simPost02" Name="TaskPanel.py" />
|
||||
<File Id="simPost03" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModsimRun" Name="simRun" FileSource="../../Mod/Ship/simRun" >
|
||||
<Component Id="CompModsimRun" Guid="8a7ad993-1006-4837-9d55-315e3721dd39" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="simRun01" Name="__init__.py" />
|
||||
<File Id="simRun02" Name="Simulation.py" />
|
||||
<File Id="simRun03" Name="TaskPanel.py" />
|
||||
<File Id="simRun04" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
<Directory Id="ModsimRunCL" Name="clSim" FileSource="../../Mod/Ship/simRun/clSim" >
|
||||
<Component Id="CompModsimRunCL" Guid="577e944a-9f25-4279-ab3a-dd464f60c229" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="clSim01" Name="__init__.py" />
|
||||
<File Id="clSim02" Name="initialization.py" />
|
||||
<File Id="clSim03" Name="Utils.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModsimRunNoCL" Name="Sim" FileSource="../../Mod/Ship/simRun/Sim" >
|
||||
<Component Id="CompModsimRunNoCL" Guid="c8655a85-20de-4f30-9924-de34a79ffa2e" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="Sim02" Name="computeSources.py" />
|
||||
<File Id="Sim02" Name="fsEvolution.py" />
|
||||
<File Id="Sim01" Name="__init__.py" />
|
||||
<File Id="Sim02" Name="initialization.py" />
|
||||
<File Id="Sim03" Name="matrixGen.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ModtankCreateTank" Name="tankCreateTank" FileSource="../../Mod/Ship/tankCreateTank" >
|
||||
<Component Id="CompModtankCreateTank" Guid="1cc53994-9e82-4731-bd37-2705a31388c6" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="tankCreateTank01" Name="__init__.py" />
|
||||
<File Id="tankCreateTank02" Name="TaskPanel.py" />
|
||||
<File Id="tankCreateTank03" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModtankGZ" Name="tankGZ" FileSource="../../Mod/Ship/tankGZ" >
|
||||
<Component Id="CompModtankGZ" Guid="ef798f90-0c85-4c5e-a637-22b97bf05303" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="tankGZ01" Name="__init__.py" />
|
||||
<File Id="tankGZ02" Name="Plot.py" />
|
||||
<File Id="tankGZ03" Name="TaskPanel.py" />
|
||||
<File Id="tankGZ04" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="ModtankWeights" Name="tankWeights" FileSource="../../Mod/Ship/tankWeights" >
|
||||
<Component Id="CompModtankWeights" Guid="77f12d48-58b0-4c95-8bee-7c4f709379d8" Win64='$(var.Win_64)' KeyPath="yes">
|
||||
<File Id="tankWeights01" Name="__init__.py" />
|
||||
<File Id="tankWeights03" Name="Preview.py" />
|
||||
<File Id="tankWeights04" Name="TaskPanel.py" />
|
||||
<File Id="tankWeights05" Name="TaskPanel.ui" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Include>
|
||||
Reference in New Issue
Block a user