Commit 00e7d94d authored by Roland Gosda's avatar Roland Gosda
Browse files

Added LGPLv3 information, added hykops_rudder to the build, merged splitted...

Added LGPLv3 information, added hykops_rudder to the build, merged splitted source files, removed obsolete files, and improved the makefile system for parallel builds on linux.
parent 2a5429ce
......@@ -65,7 +65,7 @@ find_package(libIGES)
if (NOT libIGES_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/external/libIGES.CMakeLists.txt.in ${CMAKE_BINARY_DIR}/libIGES-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build . -j WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
# find_package(libIGES REQUIRED PATHS "${CMAKE_BINARY_DIR}/external") # TODO not working
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/external/include/iges) # workaround for not finding the package by default
link_directories(${CMAKE_BINARY_DIR}/external/lib) # workaround for not finding the package by default
......@@ -83,6 +83,7 @@ add_subdirectory(hykops_core)
add_subdirectory(serializeemf)
add_subdirectory(hykops_data)
add_subdirectory(hykops_propeller)
add_subdirectory(hykops_rudder)
add_subdirectory(hykops_various)
add_subdirectory(hykops_iges)
......@@ -100,6 +101,7 @@ target_include_directories(HYKOPS PRIVATE
hykops_data
hykops_iges
hykops_propeller
hykops_rudder
hykops_various
serializeemf
)
......@@ -126,7 +128,7 @@ DESTINATION ${HYKOPS_CONFIG_INSTALL_DIR})
install(FILES ${CMAKE_SOURCE_DIR}/hykops.h
DESTINATION ${HYKOPS_INCLUDE_INSTALL_DIR})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/hykops_core ${CMAKE_SOURCE_DIR}/hykops_data ${CMAKE_SOURCE_DIR}/hykops_iges ${CMAKE_SOURCE_DIR}/hykops_propeller ${CMAKE_SOURCE_DIR}/hykops_various ${CMAKE_SOURCE_DIR}/serializeemf # source directory
install(DIRECTORY ${CMAKE_SOURCE_DIR}/hykops_core ${CMAKE_SOURCE_DIR}/hykops_data ${CMAKE_SOURCE_DIR}/hykops_iges ${CMAKE_SOURCE_DIR}/hykops_propeller ${CMAKE_SOURCE_DIR}/hykops_rudder ${CMAKE_SOURCE_DIR}/hykops_various ${CMAKE_SOURCE_DIR}/serializeemf # source directory
DESTINATION ${HYKOPS_INCLUDE_INSTALL_DIR} # target directory
FILES_MATCHING # install only matched files
PATTERN "*.h" # select header files
......
......@@ -7,7 +7,7 @@ find_library(HYKOPS_LIBRARY HYKOPS HINTS ${HYKOPS_LIBRARIES_DIR})
# Create an interface target to facilitate linking
add_library(HYKOPS INTERFACE)
target_link_libraries(HYKOPS INTERFACE ${HYKOPS_LIBRARY})
target_include_directories(HYKOPS INTERFACE ${HYKOPS_INCLUDE_DIR} ${HYKOPS_INCLUDE_DIR}/hykops_core ${HYKOPS_INCLUDE_DIR}/hykops_data ${HYKOPS_INCLUDE_DIR}/hykops_propeller ${HYKOPS_INCLUDE_DIR}/hykops_iges ${HYKOPS_INCLUDE_DIR}/hykops_various ${HYKOPS_INCLUDE_DIR}/serializeemf)
target_include_directories(HYKOPS INTERFACE ${HYKOPS_INCLUDE_DIR} ${HYKOPS_INCLUDE_DIR}/hykops_core ${HYKOPS_INCLUDE_DIR}/hykops_data ${HYKOPS_INCLUDE_DIR}/hykops_propeller ${HYKOPS_INCLUDE_DIR}/hykops_rudder ${HYKOPS_INCLUDE_DIR}/hykops_iges ${HYKOPS_INCLUDE_DIR}/hykops_various ${HYKOPS_INCLUDE_DIR}/serializeemf)
# Check for standard to use and choose highest (at least 11)
# this is required on Windows to ensure it tries to conform with one of the C++ standards below
......@@ -76,7 +76,7 @@ find_package(libIGES)
if (NOT libIGES_FOUND)
configure_file(${CMAKE_CURRENT_LIST_DIR}/external/libIGES.CMakeLists.txt.in ${CMAKE_BINARY_DIR}/libIGES-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build . -j WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/libIGES-download )
# find_package(libIGES REQUIRED PATHS "${CMAKE_BINARY_DIR}/external") # TODO not working
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/external/include/iges) # workaround for not finding the package by default
target_link_directories(HYKOPS INTERFACE ${CMAKE_BINARY_DIR}/external/lib) # workaround for not finding the package by default
......
### GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the
terms and conditions of version 3 of the GNU General Public License,
supplemented by the additional permissions listed below.
#### 0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the
GNU General Public License.
"The Library" refers to a covered work governed by this License, other
than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
#### 1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
#### 2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
- a) under this License, provided that you make a good faith effort
to ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
- b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
#### 3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a
header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
- a) Give prominent notice with each copy of the object code that
the Library is used in it and that the Library and its use are
covered by this License.
- b) Accompany the object code with a copy of the GNU GPL and this
license document.
#### 4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:
- a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
- b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
- c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
- d) Do one of the following:
- 0) Convey the Minimal Corresponding Source under the terms of
this License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
- 1) Use a suitable shared library mechanism for linking with
the Library. A suitable mechanism is one that (a) uses at run
time a copy of the Library already present on the user's
computer system, and (b) will operate properly with a modified
version of the Library that is interface-compatible with the
Linked Version.
- e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6
of the GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option
4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in
the manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.)
#### 5. Combined Libraries.
You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
- a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities, conveyed under the terms of this License.
- b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
#### 6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License "or any later version" applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License, you
may choose any version of the GNU Lesser General Public License ever
published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
# HYKOPS
HYKOPS is a geometry frameowrk for hydrodynamic components such as propellers and rudders. It was first developed by the [Flensburger Schiffbau Gesellschaft](https://www.fsg-ship.de/) and other partners in the research project HYKOPS. Currently HYKOPS is used and improved in the research project [DEffProForm](https://www.tuhh.de/panmare/applications/research-projects/current-projects/deffproform.html).
HYKOPS is a geometry framework for hydrodynamic components such as propellers and rudders. It was first developed by the [Flensburger Schiffbau Gesellschaft](https://www.fsg-ship.de/) and other partners in the research project HYKOPS. Currently HYKOPS is used and improved in the research project [DEffProForm](https://www.tuhh.de/panmare/applications/research-projects/current-projects/deffproform.html).
The framework is licensed under the [LGPL version 3.0](https://www.gnu.org/licenses/lgpl-3.0.html).
## System requirements
......
// This file is part of the HYKOPS framework
//
// HYKOPS is subject to the terms of the Lesser GNU Public License version 3.0.
// If a copy of the LGPL v3.0 was not distributed with this file, you can
// obtain one at https://www.gnu.org/licenses/lgpl-3.0.html.
// This file combines all headers from HYKOPS into one.
#ifndef hykops_h
#define hykops_h
......@@ -5,9 +13,7 @@
#include "AbstractGeometryFactory.h"
#include "AssembleFactory.h"
#include "BoundingBox.h"
// #include "C_Interface.h"
#include "CompositionFactory.h"
// #include "CompositionSerializer.h"
#include "CoordinateTransformation.h"
#include "CurveUtil.h"
#include "CurvilinearCoordinateSystemSupport.h"
......@@ -15,7 +21,6 @@
#include "Epsilon.h"
#include "ESurfaceIdentifiers.h"
#include "ESurfaceUtil.h"
// #include "EUtility.h"
#include "Export.h"
#include "ExternalSTLParser.h"
#include "HPolyLine.h"
......@@ -34,105 +39,68 @@
#include "VectorOps.h"
// hykops_data
// #include "EFactory.h"
#include "HComponent.h"
// #include "HComponent_user.h"
#include "HComposition.h"
// #include "HComposition_user.h"
#include "HCoordinateSystem3DAffine.h"
// #include "HCoordinateSystem3DAffine_user.h"
#include "HCoordinateSystem3DCartesian.h"
// #include "HCoordinateSystem3DCartesian_user.h"
#include "HCoordinateSystem3DCone.h"
// #include "HCoordinateSystem3DCone_user.h"
#include "HCoordinateSystem3DCurvilinear.h"
#include "HCoordinateSystem3DCurvilinearIsoCurveDiscrete.h"
// #include "HCoordinateSystem3DCurvilinearIsoCurveDiscrete_user.h"
#include "HCoordinateSystem3DCurvilinearIsoCurve.h"
#include "HCoordinateSystem3DCurvilinearIsoCurveParametric.h"
// #include "HCoordinateSystem3DCurvilinearIsoCurveParametric_user.h"
// #include "HCoordinateSystem3DCurvilinearIsoCurve_user.h"
// #include "HCoordinateSystem3DCurvilinear_user.h"
#include "HCoordinateSystem3D.h"
#include "HCoordinateSystem3DLofted.h"
// #include "HCoordinateSystem3DLofted_user.h"
#include "HCoordinateSystem3DPolar.h"
// #include "HCoordinateSystem3DPolar_user.h"
// #include "HCoordinateSystem3D_user.h"
#include "HCurve2D.h"
// #include "HCurve2D_user.h"
#include "HCurvePoint2D.h"
// #include "HCurvePoint2D_user.h"
#include "HDiscreteCurve2D.h"
// #include "HDiscreteCurve2D_user.h"
#include "HDiscreteLoftPath.h"
#include "HDiscreteLoftPathPoint3D.h"
// #include "HDiscreteLoftPathPoint3D_user.h"
// #include "HDiscreteLoftPath_user.h"
#include "HExternalGeometry.h"
// #include "HExternalGeometry_user.h"
#include "HExternalItem.h"
// #include "HExternalItem_user.h"
#include "HHinge.h"
// #include "HHinge_user.h"
#include "HLinearLoftPath.h"
// #include "HLinearLoftPath_user.h"
#include "HLoftElement.h"
// #include "HLoftElement_user.h"
#include "HLoft.h"
#include "HLoftPath.h"
// #include "HLoftPath_user.h"
// #include "HLoft_user.h"
#include "HPairStringDouble.h"
// #include "HPairStringDouble_user.h"
#include "HParent.h"
// #include "HParent_user.h"
#include "HPoint2D.h"
// #include "HPoint2D_user.h"
#include "HPoint3D.h"
// #include "HPoint3D_user.h"
#include "HSeriesProfileCurve2D.h"
// #include "HSeriesProfileCurve2D_user.h"
#include "HSurfaceIdentifier.h"
// #include "HSurfaceIdentifier_user.h"
// #include "qhyhash.h"
#include "uniquelist.h"
// hykops_iges
#include "CompositionParameter.h"
#include "hykops_iges.h"
#include "IgesExportTUHH.h"
#include "IgesSupport.h"
#include "hykops_iges_global.h"
#include "IgesExport.h"
#include "IgesModel.h"
#include "LoftParameter.h"
// hykops_propeller
#include "C_PropellerInterface.h"
#include "C_TipRakeInterface.h"
#include "PFFParser.h"
#include "ProfileSide.h"
#include "PropellerFactory.h"
#include "PropellerInterface.h"
#include "TipRake.h"
// hykops_rudder
#include "RudderFactory.h"
#include "RudderInterface.h"
#include "RudergeoParser.h"
// hykops_various
#include "C_VariousInterface.h"
#include "Nozzle.h"
#include "ShaftBracket.h"
#include "Shaftline.h"
#include "VariousFactory.h"
#include "VariousInterface.h"
// serializeemf
// #include "classmember.h"
// #include "debug.h"
#include "domreader.h"
#include "domwriter.h"
#include "Logger.h"
// #include "objectproperty.h"
// #include "serializedobject.h"
#endif // hykops_h
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
/* Compile with: gcc Example1.c -L/tmp/libs -lhykops_core -o run_cprogram */
long CreateObject(char *ObjectType) {
/* Routine to create an object in HYKOPS of the ObjectType.
The function returns the object handle for further usage.
*/
long ObjectHandle;
ObjectHandle = create_object(ObjectType);
return ObjectHandle;
}
long CreateHCurvePoint2D(long parent, double x1, double x2, double cC) {
/* Creates a HCurvePoint2D in HYKOPS and sets its parent and values.
The function returns the handle of the point for further usage.
*/
long HCurvePoint2DHandle;
HCurvePoint2DHandle = CreateObject("HCurvePoint2D");
set_object(HCurvePoint2DHandle,"hParent",parent);
set_double(HCurvePoint2DHandle,"x1",x1);
set_double(HCurvePoint2DHandle,"x2",x2);
set_double(HCurvePoint2DHandle,"curveCoordinate",cC);
return HCurvePoint2DHandle;
}
long CreateHPoint3D(long parent, double x1, double x2, double x3) {
/* Creates a HPoint3D in HYKOPS and sets its parent and values.
The function returns the handle of the point for further usage.
*/
long HPoint3DHandle;
HPoint3DHandle = CreateObject("HPoint3D");
set_object(HPoint3DHandle,"hParent",parent);
set_double(HPoint3DHandle,"x1",x1);
set_double(HPoint3DHandle,"x2",x2);
set_double(HPoint3DHandle,"x3",x3);
return HPoint3DHandle;
}
void ListArrayEntries(long ObjectHandle, char *ParameterName) {
/* Printing function to display the content of a list in an object.
The results are printed to the terminal.
*/
int listsize;
int i;
listsize = get_list_size(ObjectHandle, ParameterName);
long array[listsize];
get_list(ObjectHandle, ParameterName, array, listsize);
printf("\n");
printf("- %s -", ParameterName);
printf("\n");
for(i = 0; i < listsize; i = i + 1) {
printf("Entry %d of %s: %d \n", i+1, ParameterName, array[i]);
}
printf("\n");
/* */
}
int main()
{
/* Initialize the variables.
*/
long ReturnVal;
long CompositionHandle,ComponentHandle,CoSysHandle,CoSysOriginHandle,
CoSysLengthHandle,CoSysTurnHandle,LoftHandle,SurfaceIdentifierHandle,
CoSysAxialHandle,CoSysRadialHandle,CoSysAngleHandle,LoftPathHandle,
CoSysX1Handle,CoSysX2Handle,CoSysX3Handle,PathOriginHandle,PathVectorHandle,
PathXiVectorHandle,PathEtaVectorHandle,LoftElementHandleA,LoftElementHandleB,
CurveHandleA,CurveHandleB,CurvePointHandleA,CurvePointHandleB,
CurvePointHandleC,CurvePointHandleD,CurvePointHandleE,CurvePointHandleF,
CurvePointHandleG,CurvePointHandleH;
int keylength,valuelength;
/* ###########################
####### Composition #######
###########################
### Create Composition ###
Generate a HComposition-Object in HYKOPS.
The Handle (ID) is stored in the variable CompHandle.
*/
CompositionHandle = create_HComposition("CompA","FirstCompFromC");
/* ### Create CoordinateSystem3D and Points ###
Generate a CoordinateSystem3D in HYKOPS for the composition.
The Coordinate System needs an origin, a length for each axis
and an angle (in case it's turned around the global system).
The parent object of the coordinate system is the composition.
*/
CoSysHandle = CreateObject("HCoordinateSystem3DCartesian");
set_object(CoSysHandle,"hParent",CompositionHandle);
/* The HPoint3D is created with a predefined function (see line 24 etc.).
*/
CoSysOriginHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"origin",CoSysOriginHandle);
CoSysLengthHandle = CreateHPoint3D(CoSysHandle,1.,1.,1.);
set_object(CoSysHandle,"x1",CoSysLengthHandle);
CoSysTurnHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"e1",CoSysTurnHandle);
/* #########################
####### Component #######
#########################
### Create Component ###
Each Composition holds Components. The parent of the Component is
the Composition. The Composition holds a list of Components, which
has to be filled with the Component handles.
*/
ComponentHandle = CreateObject("HComponent");
set_object(ComponentHandle,"hParent",CompositionHandle);
ReturnVal = add_to_list(CompositionHandle,"hComponents",ComponentHandle);
/* ### Set Details of Component ###
Each Component can get a name and a description.
*/
set_string(ComponentHandle,"name","FirstComponent");
set_string(ComponentHandle,"description","FirstComponentcreatedbymyself");
/* ### Create CoordinateSystem3D and Points ###
Generate a Cartesian coordinate system in HYKOPS for the component.
The Coordinate System needs an origin, a length scale for each axis
and an angle.
The parent object of the coordinate system is the component.
*/
CoSysHandle = CreateObject("HCoordinateSystem3DCartesian");
set_object(CoSysHandle,"hParent",CompositionHandle);
/* The HPoint3D is created with a predefined function (see line 24 etc.).
*/
CoSysOriginHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"origin",CoSysOriginHandle);
CoSysLengthHandle = CreateHPoint3D(CoSysHandle,1.,1.,1.);
set_object(CoSysHandle,"x1",CoSysLengthHandle);
CoSysTurnHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"e1",CoSysTurnHandle);
/* ### Set Coordinate System as Component Coordinate System ###
The composition holds a list of coordinate systems.
Each coordinate system should be registered there.
The component requires a coordinate system to define its position
and direction in the composition coordinate system.
*/
set_object(ComponentHandle,"hCoordinateSystem3D",CoSysHandle);
ReturnVal = add_to_list(CompositionHandle,"hCoordinateSystems",CoSysHandle);
/* ####################
####### Loft #######
####################
### Create Loft ###
Each component holds lofts. The parent of the loft is
the component. The component holds a list of lofts, which
has to be filled with the loft handles.
*/
LoftHandle = CreateObject("HLoft");
ReturnVal = add_to_list(ComponentHandle,"hLofts", LoftHandle);
set_object(LoftHandle,"hParent",ComponentHandle);
/* Each loft needs to know the component where it belongs to.
Each loft can get a name and description for further information.
*/
set_object(LoftHandle,"hComponent",ComponentHandle);
set_string(LoftHandle,"name","FirstLoft");
set_string(LoftHandle,"description","FirstLoftcreatedbymyself");
/* ### Create a Surface Identifier Marker ###
A loft requires an identifier to mark the corresponding surface.
For a propeller, the pressure and suction side are typical markers.
*/
SurfaceIdentifierHandle = CreateObject("HSurfaceIdentifier");
set_string(SurfaceIdentifierHandle,"name","PROFILE_SUCTION_SIDE");
ReturnVal = add_to_list(LoftHandle,"hSurfaceIdentifications",SurfaceIdentifierHandle);
/* ### Create CoordinateSystem3D and Points ###
A loft needs 2 coordinate systems. The first system defines position,
axis length and angle of the loft in the component coordinate system.
*/
CoSysHandle = CreateObject("HCoordinateSystem3DCartesian");
set_object(CoSysHandle,"hParent",LoftHandle);
CoSysOriginHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"origin",CoSysOriginHandle);
CoSysLengthHandle = CreateHPoint3D(CoSysHandle,1.,1.,1.);
set_object(CoSysHandle,"x1",CoSysLengthHandle);
CoSysTurnHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"e1",CoSysTurnHandle);
/* The coordinate system needs to be registered in the list of coordinate
systems of the loft and the composition.
*/
ReturnVal = add_to_list(CompositionHandle,"hCoordinateSystems",CoSysHandle);
ReturnVal = add_to_list(LoftHandle,"hCoordinateSystems3D",CoSysHandle);
/* ### Create CoordinateSystem3DPolar ###
The polar coordinate system allows the user to place curves on cylinders.
A polar coordinate system requires an origin, axis and angles. Since all
following objects are therefore placed in the polar coordinate system,
all LoftElements belonging to this loft will be transformed to
polar coordinates.
*/
CoSysHandle = CreateObject("HCoordinateSystem3DPolar");
set_object(CoSysHandle,"hParent",LoftHandle);
CoSysOriginHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"origin",CoSysOriginHandle);
CoSysAxialHandle = CreateHPoint3D(CoSysHandle,1.,0.,0.);
set_object(CoSysHandle,"axialVector",CoSysAxialHandle);
CoSysRadialHandle = CreateHPoint3D(CoSysHandle,0.,0.,1.);
set_object(CoSysHandle,"radialVector",CoSysRadialHandle);
CoSysAngleHandle = CreateHPoint3D(CoSysHandle,0.,0.,0.);
set_object(CoSysHandle,"angle",CoSysAngleHandle);
/* The coordinate system needs to be registered in the list of coordinate
systems of the loft and the composition.
*/
ReturnVal = add_to_list(CompositionHandle,"hCoordinateSystems",CoSysHandle);
ReturnVal = add_to_list(LoftHandle,"hCoordinateSystems3D",CoSysHandle);
/* ### Set Key for Blade number in Loft ###
The loft contains a key map called 'parameters', where keys can be set.
The key map contains in this case informatio about the periodicity referring
to the blade count.
*/
char stringkey_a[15] = "PERIODIC_ROTATE";
keylength = strlen(stringkey_a);
char stringvalue_a[33];
sprintf(stringvalue_a,"%16.4f %16.4f %16.4f %8.4f %05d",1.,0.,0.,360.,4);
valuelength = strlen(stringvalue_a);
add_to_map(LoftHandle,"parameters",stringkey_a,keylength,stringvalue_a,valuelength);
/* ### Set Key for Interpolation in Loft ###
Another key in the map 'parameters' provides information about the interpolation
routine of the loft surface. In this case, the interpolation should be linear.
Different interpolation schemes, also based on splines, are implemented in HYKOPS.
The interpolation schemes have prescribed key names.
*/
char stringkey_b[20] = "LOFTINTERPOLATIONKEY";
keylength = strlen(stringkey_b);
char stringvalue_b[6] = "LINEAR";
valuelength = strlen(stringvalue_b);
add_to_map(LoftHandle,"parameters",stringkey_b,keylength,stringvalue_b,valuelength);
/* ##########################
######### LoftPath #######
##########################