You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(144) |
Jul
(5) |
Aug
(23) |
Sep
(3) |
Oct
(8) |
Nov
(6) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(34) |
Apr
(1) |
May
(10) |
Jun
(12) |
Jul
(17) |
Aug
(28) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(3) |
2011 |
Jan
(4) |
Feb
(7) |
Mar
(5) |
Apr
(1) |
May
|
Jun
(15) |
Jul
(1) |
Aug
(7) |
Sep
(9) |
Oct
(3) |
Nov
|
Dec
(1) |
2012 |
Jan
(1) |
Feb
(13) |
Mar
(6) |
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(9) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wol...@us...> - 2009-06-23 08:00:04
|
Revision: 104 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=104&view=rev Author: wolfspindler Date: 2009-06-23 07:59:00 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Platform independent min/mlMin template functions require identical types, thus using the larger one (MLint) for both sides now. Modified Paths: -------------- trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp Modified: trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp =================================================================== --- trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2009-06-23 07:28:54 UTC (rev 103) +++ trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2009-06-23 07:59:00 UTC (rev 104) @@ -1578,7 +1578,7 @@ //horizontal if (searchPoint.y-searchDist>0) { - for (int i=searchPoint.x; i<mlMin(_sliceSizeOpt.x,searchPoint.x+searchDist); i++) //to the right + for (int i=searchPoint.x; i<mlMin(_sliceSizeOpt.x,static_cast<MLint>(searchPoint.x+searchDist)); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y-searchDist)==1) { @@ -1654,7 +1654,7 @@ //horizontal if (searchPoint.y+searchDist<_sliceSizeOpt.y) { - for (int i=searchPoint.x; i<mlMin(_sliceSizeOpt.x,searchPoint.x+searchDist); i++) //to the right + for (int i=searchPoint.x; i<mlMin(_sliceSizeOpt.x,static_cast<MLint>(searchPoint.x+searchDist)); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y+searchDist)==1) { @@ -1669,7 +1669,7 @@ //vertical if (searchPoint.x+searchDist<_sliceSizeOpt.x) { - for (int i=searchPoint.y; i<mlMin(_sliceSizeOpt.y,searchPoint.y+searchDist); i++) //to the bottom + for (int i=searchPoint.y; i<mlMin(_sliceSizeOpt.y,static_cast<MLint>(searchPoint.y+searchDist)); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x+searchDist,i)==1) { @@ -1708,7 +1708,7 @@ //vertical if (searchPoint.x-searchDist>0) { - for (int i=searchPoint.y; i<mlMin(_sliceSizeOpt.y,searchPoint.y+searchDist); i++) //to the bottom + for (int i=searchPoint.y; i<mlMin(_sliceSizeOpt.y,static_cast<MLint>(searchPoint.y+searchDist)); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x-searchDist,i)==1) { @@ -1731,7 +1731,7 @@ //horizontal if (searchPoint.y-searchDist>0) { - for (int i=mlMax(1,searchPoint.x-searchDist); i<mlMin(_sliceSizeOpt.x,searchPoint.x+searchDist); i++) //to the right + for (int i=mlMax(1,searchPoint.x-searchDist); i<mlMin(_sliceSizeOpt.x,static_cast<MLint>(searchPoint.x+searchDist)); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y-searchDist)==1) { @@ -1780,7 +1780,7 @@ //horizontal if (searchPoint.y+searchDist<_sliceSizeOpt.y) { - for (int i=mlMax(1,searchPoint.x-searchDist); i<mlMin(_sliceSizeOpt.x,searchPoint.x+searchDist); i++) //to the right + for (int i=mlMax(1,searchPoint.x-searchDist); i<mlMin(_sliceSizeOpt.x,static_cast<MLint>(searchPoint.x+searchDist)); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y+searchDist)==1) { @@ -1794,7 +1794,7 @@ //right vertical if (searchPoint.x+searchDist<_sliceSizeOpt.x) { - for (int i=searchPoint.y; i<mlMin(searchPoint.y+searchDist,_sliceSizeOpt.y); i++) //to the bottom + for (int i=searchPoint.y; i<mlMin(static_cast<MLint>(searchPoint.y+searchDist),_sliceSizeOpt.y); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x+searchDist,i)==1) { @@ -1808,7 +1808,7 @@ //left vertical if (searchPoint.x-searchDist>0) { - for (int i=searchPoint.y; i<mlMin(searchPoint.y+searchDist,_sliceSizeOpt.y); i++) //to the bottom + for (int i=searchPoint.y; i<mlMin(static_cast<MLint>(searchPoint.y+searchDist),_sliceSizeOpt.y); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x-searchDist,i)==1) { @@ -1858,7 +1858,7 @@ //vertical if (searchPoint.x-searchDist>0) { - for (int i=mlMax(searchPoint.y-searchDist,1); i<mlMin(_sliceSizeOpt.y,searchPoint.y+searchDist); i++) //to the bottom + for (int i=mlMax(searchPoint.y-searchDist,1); i<mlMin(_sliceSizeOpt.y,static_cast<MLint>(searchPoint.y+searchDist)); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x-searchDist,i)==1) { @@ -1879,7 +1879,7 @@ //first horizontal if (searchPoint.y+searchDist<_sliceSizeOpt.y) { - for (int i=searchPoint.x; i<mlMin(searchPoint.x+searchDist,_sliceSizeOpt.x); i++) //to the right + for (int i=searchPoint.x; i<mlMin(static_cast<MLint>(searchPoint.x+searchDist),_sliceSizeOpt.x); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y+searchDist)==1) { @@ -1893,7 +1893,7 @@ //second horizontal if (searchPoint.y-searchDist>0) { - for (int i=searchPoint.x; i<mlMin(searchPoint.x+searchDist,_sliceSizeOpt.x); i++) //to the right + for (int i=searchPoint.x; i<mlMin(static_cast<MLint>(searchPoint.x+searchDist),_sliceSizeOpt.x); i++) //to the right { if (_components[compID].freeSpaceField->getValueAt(i,searchPoint.y-searchDist)==1) { @@ -1907,7 +1907,7 @@ //vertical if (searchPoint.x+searchDist<_sliceSizeOpt.x) { - for (int i=mlMax(searchPoint.y-searchDist,1); i<mlMin(_sliceSizeOpt.y,searchPoint.y+searchDist); i++) //to the bottom + for (int i=mlMax(searchPoint.y-searchDist,1); i<mlMin(_sliceSizeOpt.y,static_cast<MLint>(searchPoint.y+searchDist)); i++) //to the bottom { if (_components[compID].freeSpaceField->getValueAt(searchPoint.x+searchDist,i)==1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-23 07:30:35
|
Revision: 103 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=103&view=rev Author: wolfspindler Date: 2009-06-23 07:28:54 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -In ISO standard non allowed extra qualfification removed. Modified Paths: -------------- trunk/Community/METK/Sources/Inventor/UMDSoView2DExtensions/SoTextureMaskedArea.h Modified: trunk/Community/METK/Sources/Inventor/UMDSoView2DExtensions/SoTextureMaskedArea.h =================================================================== --- trunk/Community/METK/Sources/Inventor/UMDSoView2DExtensions/SoTextureMaskedArea.h 2009-06-23 07:26:55 UTC (rev 102) +++ trunk/Community/METK/Sources/Inventor/UMDSoView2DExtensions/SoTextureMaskedArea.h 2009-06-23 07:28:54 UTC (rev 103) @@ -5,7 +5,7 @@ // \author Bj\xF6rn Meyer // \date 2005-07-20 // -// +// */ //---------------------------------------------------------------------------------- @@ -49,86 +49,86 @@ -//! +//! class UMDSOVIEW2DEXTENSIONS_EXPORT SoTextureMaskedArea : public SoView2DExtension { //! Implements the runtime type system interface of this new node. SO_NODE_HEADER(SoTextureMaskedArea); - + public: //! Constructor SoTextureMaskedArea(); - + //! Initializes this class (called on dll initialization). static void initClass(); - - - + + + //! Handling of events occurring in the viewer. virtual bool evalEvent(SoView2D *view2d, View2DSliceList *list, View2DEvent* event, View2DEventPhase phase); - + //! Virtual method called by the \c SoView2D node when an image is rendered. virtual void draw(View2DSliceList *list, View2DSlice *slice, int z); - + //! reimplemented from SoNode, stores the LUT for later rendering void GLRender(SoGLRenderAction *action); - + // input connectors for texture image and mask image SoSFMLImage inTexture, inMask; - + SoSFColor overlayColour; SoSFInt32 currentSlice, chooseTexture; SoSFFloat overlayAlpha; SoSFBool showTextureOnly; SoSFEnum chooseTextureEnum; - + protected: //! Protected destructor virtual ~SoTextureMaskedArea(); - + // function for texture computation - void SoTextureMaskedArea::computeTexture(); - + void computeTexture(); + //! Sensor to detect changes in node's fields. SoNodeSensor *_nodeSensor; // field sensor for texture choice - SoFieldSensor *_chooseTextureSens; - + SoFieldSensor *_chooseTextureSens; + //! Called by \c _nodeSensor when any field in node changes. //! Only redirects the call of this static function to the //! class method \c nodeChanged. static void nodeChangedCB(void *data, SoSensor* sens); //! Called by the static function \c _nodeChangedCB to notify node changes. void nodeChanged(SoNodeSensor* sensor); - - + + // texture selection callback routines - static void textureChangedCB(void* userData, SoSensor* sensor); + static void textureChangedCB(void* userData, SoSensor* sensor); void textureChanged(SoFieldSensor* sensor); - - + + //! the lut data that is rendered ml::LUTData<MLuint8>* _lutData; //! the lut from the scene, stored by GLRender ml::LUTFunction* _lutFunction; - + ml::LUTFColor _lutTransform; - - + + private: - + // your own member functions... - - + + // your own member variables... int tx, ty, tz, tc, mx, my, mz, ox, oy, oz, drawCounter; bool textureOK, mOk, oOk; void *textureData, *textureBigData, *maskData, *imageData, *originalData; _ML_UINT8 *tPointer, *tgPointer, *tbPointer, *tBPointer, *mPointer, *iPointer, *oPointer; - + enum textureModes {fromFile, Checkerboard, Diagonal1, Diagonal2, Horizontal, Vertical}; - + }; #endif // __SOTEXTUREMASKEDAREA_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-23 07:27:01
|
Revision: 102 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=102&view=rev Author: wolfspindler Date: 2009-06-23 07:26:55 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Missing include of vector added. Modified Paths: -------------- trunk/Community/METK/Sources/Inventor/SoQHull3D/SoQHull3D.h Modified: trunk/Community/METK/Sources/Inventor/SoQHull3D/SoQHull3D.h =================================================================== --- trunk/Community/METK/Sources/Inventor/SoQHull3D/SoQHull3D.h 2009-06-23 06:29:20 UTC (rev 101) +++ trunk/Community/METK/Sources/Inventor/SoQHull3D/SoQHull3D.h 2009-06-23 07:26:55 UTC (rev 102) @@ -41,10 +41,12 @@ #include "XVLeaveScope.h" +#include <vector> + // QHull: include extern "C" { - #include "qhull/qhull_a.h" + #include "qhull/qhull_a.h" } //QHull: global vector for input points @@ -81,10 +83,10 @@ //@{! fields SoSFInt32 numInput; SoSFInt32 numOutput; - SoSFInt32 numTriangles; + SoSFInt32 numTriangles; - SoSFInt32 ch_surface; - SoSFInt32 ch_volume; + SoSFInt32 ch_surface; + SoSFInt32 ch_volume; SoSFBool showPoints; SoSFBool showFaces; @@ -96,12 +98,12 @@ SoSFString state; - //! 'hidden' fields in automatic panel - SoSFBool showNormals; - SoSFBool useFaceNormals; + //! 'hidden' fields in automatic panel + SoSFBool showNormals; + SoSFBool useFaceNormals; - //! output - SoSFNode out_qhull; + //! output + SoSFNode out_qhull; //@} @@ -123,49 +125,49 @@ //! callback action for collectiong primitives of an open inventor scene SoCallbackAction *callbackAction; - + //! called when entering a node during callback static SoCallbackAction::Response preCB(void *userData, SoCallbackAction *action, const SoNode *node); //! called if the child is a shape (consisting of points) static void pointCB(void *userData, SoCallbackAction *action, - const SoPrimitiveVertex *v); + const SoPrimitiveVertex *v); //! called if the child is a shape (consisting of line segments) static void lineSegmentCB(void *userData, SoCallbackAction *action, - const SoPrimitiveVertex *v1, + const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2); //! called if the child is a shape (consisting of triangles) static void triangleCB(void *userData, SoCallbackAction *action, - const SoPrimitiveVertex *v1, + const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3); //! collects points, lines and triangles of the inventor scene - void collectPrimitives(); + void collectPrimitives(); - //! execute QHull - void callQHull(); + //! execute QHull + void callQHull(); - //! drawing routines - void drawPoints(); - void drawFaces(); - void drawNormals(); + //! drawing routines + void drawPoints(); + void drawFaces(); + void drawNormals(); private: - //! group for output - SoGroup *output; + //! group for output + SoGroup *output; - //! separators for points, faces and normals - SoSeparator *chPoints, *chFaces, *chNormals; + //! separators for points, faces and normals + SoSeparator *chPoints, *chFaces, *chNormals; - //! state variable - bool convexHullFound; + //! state variable + bool convexHullFound; - //! transformation matrix - SbMatrix transMatrix; + //! transformation matrix + SbMatrix transMatrix; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-23 06:30:32
|
Revision: 101 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=101&view=rev Author: wolfspindler Date: 2009-06-23 06:29:20 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Replaced min and max by platform independent ML version. Modified Paths: -------------- trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp Property Changed: ---------------- trunk/Community/METK/Sources/ML/METK2DLabeling/ Property changes on: trunk/Community/METK/Sources/ML/METK2DLabeling ___________________________________________________________________ Added: svn:ignore + METK2DLabeling.sln METK2DLabeling.suo METK2DLabeling.vcproj METK2DLabeling.vcproj.lapsus-win.wolf.user Modified: trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp =================================================================== --- trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2009-06-23 06:16:09 UTC (rev 100) +++ trunk/Community/METK/Sources/ML/METK2DLabeling/mlMETK2DLabeling.cpp 2009-06-23 06:29:20 UTC (rev 101) @@ -42,141 +42,141 @@ //---------------------------------------------------------------------------------- METK2DLabeling::METK2DLabeling () : inherited(2,1,ObjMgrClient::EVENTS_SELECTED) { - ML_TRACE_IN("METK2DLabeling::METK2DLabeling ()"); + ML_TRACE_IN("METK2DLabeling::METK2DLabeling ()"); - // Get reference to the container for parameters/fields. - FieldContainer &fields = *getFieldContainer(); + // Get reference to the container for parameters/fields. + FieldContainer &fields = *getFieldContainer(); - // Suppress calls of handleNotification on field changes. - handleNotificationOff(); + // Suppress calls of handleNotification on field changes. + handleNotificationOff(); - _optFactor = 2.0; + _optFactor = 2.0; - // Add fields to the module and set their values. - // Also attach them to the output images to notify connected modules about changes. - _sliceFld = fields.addInt("slice"); - _sliceFld->setIntValue(0); - _sliceFld->attachField(getOutField(0)); - _enableLabelingFld = fields.addBool("enableLabeling"); - _enableLabelingFld->setBoolValue(true); - //_enableLabelingFld->attachField(getOutField(0)); - _maxConflictIterationsFld = fields.addInt("maxConflictIterations"); - _maxConflictIterationsFld->setIntValue(20); - _maxConflictIterationsFld->attachField(getOutField(0)); - _calculateFld = fields.addNotify("calculate"); - //_calculateFld->attachField(getOutField(0)); - _initPlacementFld = fields.addNotify("initPlacement"); - //_initPlacementFld->attachField(getOutField(0)); - _refineFld = fields.addNotify("refine"); - //_refineFld->attachField(getOutField(0)); - _refineSingleStepFld = fields.addNotify("refineSingleStep"); - //_refineSingleStepFld->attachField(getOutField(0)); + // Add fields to the module and set their values. + // Also attach them to the output images to notify connected modules about changes. + _sliceFld = fields.addInt("slice"); + _sliceFld->setIntValue(0); + _sliceFld->attachField(getOutField(0)); + _enableLabelingFld = fields.addBool("enableLabeling"); + _enableLabelingFld->setBoolValue(true); + //_enableLabelingFld->attachField(getOutField(0)); + _maxConflictIterationsFld = fields.addInt("maxConflictIterations"); + _maxConflictIterationsFld->setIntValue(20); + _maxConflictIterationsFld->attachField(getOutField(0)); + _calculateFld = fields.addNotify("calculate"); + //_calculateFld->attachField(getOutField(0)); + _initPlacementFld = fields.addNotify("initPlacement"); + //_initPlacementFld->attachField(getOutField(0)); + _refineFld = fields.addNotify("refine"); + //_refineFld->attachField(getOutField(0)); + _refineSingleStepFld = fields.addNotify("refineSingleStep"); + //_refineSingleStepFld->attachField(getOutField(0)); - (_optFactorFld = fields.addInt("optFactor"))->setIntValue(2); + (_optFactorFld = fields.addInt("optFactor"))->setIntValue(2); - _debugOutputFld = fields.addEnum("debugOutput", debugOutputStrings, NUM_DEBUGOUTPUT); - _debugOutputFld->setEnumValue(2); - //_debugOutputFld->attachField(getOutField(0)); + _debugOutputFld = fields.addEnum("debugOutput", debugOutputStrings, NUM_DEBUGOUTPUT); + _debugOutputFld->setEnumValue(2); + //_debugOutputFld->attachField(getOutField(0)); - _debugStateFld = fields.addEnum("debugState", debugStateStrings, NUM_DEBUGSTATEOUTPUT); - _debugStateFld->setEnumValue(1); + _debugStateFld = fields.addEnum("debugState", debugStateStrings, NUM_DEBUGSTATEOUTPUT); + _debugStateFld->setEnumValue(1); - (_anchorPointInspectionFld = fields.addInt("anchorPointInspection"))->setIntValue(1); - //_anchorPointInspectionFld->attachField(getOutField(0)); + (_anchorPointInspectionFld = fields.addInt("anchorPointInspection"))->setIntValue(1); + //_anchorPointInspectionFld->attachField(getOutField(0)); - (_borderDistanceFld = fields.addInt("borderDistance"))->setIntValue(7); - //_borderDistanceFld->attachField(getOutField(0)); + (_borderDistanceFld = fields.addInt("borderDistance"))->setIntValue(7); + //_borderDistanceFld->attachField(getOutField(0)); - (_minCompSizeFld = fields.addInt("minCompSize"))->setIntValue(2); - //_minCompSizeFld->attachField(getOutField(0)); + (_minCompSizeFld = fields.addInt("minCompSize"))->setIntValue(2); + //_minCompSizeFld->attachField(getOutField(0)); - (_maxGroupDistanceFld = fields.addInt("maxGroupDistance"))->setIntValue(50); - //_maxGroupDistanceFld->attachField(getOutField(0)); + (_maxGroupDistanceFld = fields.addInt("maxGroupDistance"))->setIntValue(50); + //_maxGroupDistanceFld->attachField(getOutField(0)); - (_transpThresholdFld = fields.addDouble("transpThreshold"))->setDoubleValue(0.8); + (_transpThresholdFld = fields.addDouble("transpThreshold"))->setDoubleValue(0.8); - (_encircleSizeFld = fields.addInt("encircleSize"))->setIntValue(5); + (_encircleSizeFld = fields.addInt("encircleSize"))->setIntValue(5); - (_textColorFld = fields.addColor("textColor"))->setColorValue(0,0,0); - (_boxColorFld = fields.addColor("boxColor"))->setColorValue(1,1,1); - (_boxTransparencyFld = fields.addDouble("boxTransparency"))->setDoubleValue(0.3); - (_borderColorFld = fields.addColor("borderColor"))->setColorValue(0,0,0); - (_lineColorFld = fields.addColor("lineColor"))->setColorValue(1,1,0); - (_autoBoxColorFld = fields.addBool("autoBoxColor"))->setBoolValue(false); - (_innerBorderFld = fields.addInt("innerBorder"))->setIntValue(2); + (_textColorFld = fields.addColor("textColor"))->setColorValue(0,0,0); + (_boxColorFld = fields.addColor("boxColor"))->setColorValue(1,1,1); + (_boxTransparencyFld = fields.addDouble("boxTransparency"))->setDoubleValue(0.3); + (_borderColorFld = fields.addColor("borderColor"))->setColorValue(0,0,0); + (_lineColorFld = fields.addColor("lineColor"))->setColorValue(1,1,0); + (_autoBoxColorFld = fields.addBool("autoBoxColor"))->setBoolValue(false); + (_innerBorderFld = fields.addInt("innerBorder"))->setIntValue(2); - (_useAdditionalMaskFld = fields.addBool("useAdditionalMask"))->setBoolValue(false); + (_useAdditionalMaskFld = fields.addBool("useAdditionalMask"))->setBoolValue(false); - (_sendCSOFld = fields.addBool("sendCSO"))->setBoolValue(true); - (_CSOFld = fields.addString("CSO"))->setStringValue(""); + (_sendCSOFld = fields.addBool("sendCSO"))->setBoolValue(true); + (_CSOFld = fields.addString("CSO"))->setStringValue(""); - _2dLabelsNode = new SoDraw2DLabels(); - _2dLabelsNode->ref(); - _outInventor = getFieldContainer()->addSoNode("outInventor"); - _outInventor->setSoNodeValue(_2dLabelsNode); + _2dLabelsNode = new SoDraw2DLabels(); + _2dLabelsNode->ref(); + _outInventor = getFieldContainer()->addSoNode("outInventor"); + _outInventor->setSoNodeValue(_2dLabelsNode); - _2dLabelsNode->setFontSize(12); - _2dLabelsNode->setSendCSO(_sendCSOFld->getBoolValue()); + _2dLabelsNode->setFontSize(12); + _2dLabelsNode->setSendCSO(_sendCSOFld->getBoolValue()); - _voxelValues = NULL; - _additionalMask = NULL; - _componentIDs = NULL; - _globalDistanceField = NULL; - _textFreeSpaceHorizontalField.resize(2); - _textFreeSpaceHorizontalField[0] = NULL; - _textFreeSpaceHorizontalField[1] = NULL; - _tempFieldForLabelBoxes = NULL; + _voxelValues = NULL; + _additionalMask = NULL; + _componentIDs = NULL; + _globalDistanceField = NULL; + _textFreeSpaceHorizontalField.resize(2); + _textFreeSpaceHorizontalField[0] = NULL; + _textFreeSpaceHorizontalField[1] = NULL; + _tempFieldForLabelBoxes = NULL; - myObjMgr = new ObjMgrCommunicator(); - myObjIterator = new ObjConstrainedIterator(); + myObjMgr = new ObjMgrCommunicator(); + myObjIterator = new ObjConstrainedIterator(); - timerSensor = new SoTimerSensor((SoSensorCB*)METK2DLabeling::timerEvent, this); - timerSensor->setInterval(SbTime(1.0/4.0)); - timerSensor->unschedule(); + timerSensor = new SoTimerSensor((SoSensorCB*)METK2DLabeling::timerEvent, this); + timerSensor->setInterval(SbTime(1.0/4.0)); + timerSensor->unschedule(); - //Der FieldSensor ist n\xF6tig, um auf Ereignisse von Inventormodulen (Bspw. Ready-Trigger) von internen Inventormodulen zu h\xF6ren - _fieldSensor = new SoFieldSensor(METK2DLabeling::fieldChangedCB, this); - _fieldSensor->setPriority(0); - _fieldSensor->attach(_2dLabelsNode->getField("_CSOFld")); + //Der FieldSensor ist n\xF6tig, um auf Ereignisse von Inventormodulen (Bspw. Ready-Trigger) von internen Inventormodulen zu h\xF6ren + _fieldSensor = new SoFieldSensor(METK2DLabeling::fieldChangedCB, this); + _fieldSensor->setPriority(0); + _fieldSensor->attach(_2dLabelsNode->getField("_CSOFld")); - // Connect input fields with output field to update connected - // modules if input images change. - for (int inIdx=0; inIdx < 1; ++inIdx){ - for (int outIdx=0; outIdx < 1; ++outIdx){ - getInField(inIdx)->attachField(getOutField(outIdx)); - } - } + // Connect input fields with output field to update connected + // modules if input images change. + for (int inIdx=0; inIdx < 1; ++inIdx){ + for (int outIdx=0; outIdx < 1; ++outIdx){ + getInField(inIdx)->attachField(getOutField(outIdx)); + } + } - // Reactivate calls of handleNotification on field changes. - handleNotificationOn(); + // Reactivate calls of handleNotification on field changes. + handleNotificationOn(); } METK2DLabeling::~METK2DLabeling() { - if (_voxelValues) delete _voxelValues; - _voxelValues = NULL; - if (_additionalMask) delete _additionalMask; - _additionalMask = NULL; - if (_componentIDs) delete _componentIDs; - _componentIDs = NULL; - if (_globalDistanceField) delete _globalDistanceField; - _globalDistanceField = NULL; - if (_textFreeSpaceHorizontalField[0]) delete _textFreeSpaceHorizontalField[0]; - _textFreeSpaceHorizontalField[0] = NULL; - if (_textFreeSpaceHorizontalField[1]) delete _textFreeSpaceHorizontalField[1]; - _textFreeSpaceHorizontalField[1] = NULL; - if (_tempFieldForLabelBoxes) delete _tempFieldForLabelBoxes; - _tempFieldForLabelBoxes = NULL; + if (_voxelValues) delete _voxelValues; + _voxelValues = NULL; + if (_additionalMask) delete _additionalMask; + _additionalMask = NULL; + if (_componentIDs) delete _componentIDs; + _componentIDs = NULL; + if (_globalDistanceField) delete _globalDistanceField; + _globalDistanceField = NULL; + if (_textFreeSpaceHorizontalField[0]) delete _textFreeSpaceHorizontalField[0]; + _textFreeSpaceHorizontalField[0] = NULL; + if (_textFreeSpaceHorizontalField[1]) delete _textFreeSpaceHorizontalField[1]; + _textFreeSpaceHorizontalField[1] = NULL; + if (_tempFieldForLabelBoxes) delete _tempFieldForLabelBoxes; + _tempFieldForLabelBoxes = NULL; - if (myObjMgr) delete myObjMgr; - myObjMgr = NULL; - if (myObjIterator) delete myObjIterator; - myObjIterator = NULL; + if (myObjMgr) delete myObjMgr; + myObjMgr = NULL; + if (myObjIterator) delete myObjIterator; + myObjIterator = NULL; - if (timerSensor) delete timerSensor; - timerSensor = NULL; + if (timerSensor) delete timerSensor; + timerSensor = NULL; } //---------------------------------------------------------------------------------- @@ -184,63 +184,63 @@ //---------------------------------------------------------------------------------- void METK2DLabeling::handleNotification (Field *field) { - ML_TRACE_IN("METK2DLabeling::handleNotification ()"); + ML_TRACE_IN("METK2DLabeling::handleNotification ()"); - if (field == getFieldContainer()->getField("inObjectContainer")) - { - if (getFieldContainer()->getField("inObjectContainer")->getDestinationField (0) == NULL) - { - //Verbinden aller inObjectContainer innerhalb des Moduls - getFieldContainer()->getField("inObjectContainer")->attachField(myObjMgr->getFieldContainer()->getField("inObjectContainer"),1); - getFieldContainer()->getField("inObjectContainer")->attachField(myObjIterator->getFieldContainer()->getField("inObjectContainer"),1); - } - } - else if (field == _initPlacementFld) - { - initialPlacement(); - transferLabelsToInventor(); - } + if (field == getFieldContainer()->getField("inObjectContainer")) + { + if (getFieldContainer()->getField("inObjectContainer")->getDestinationField (0) == NULL) + { + //Verbinden aller inObjectContainer innerhalb des Moduls + getFieldContainer()->getField("inObjectContainer")->attachField(myObjMgr->getFieldContainer()->getField("inObjectContainer"),1); + getFieldContainer()->getField("inObjectContainer")->attachField(myObjIterator->getFieldContainer()->getField("inObjectContainer"),1); + } + } + else if (field == _initPlacementFld) + { + initialPlacement(); + transferLabelsToInventor(); + } - else if (field== _refineSingleStepFld) - { - resolveConflicts(); - transferLabelsToInventor(); - } + else if (field== _refineSingleStepFld) + { + resolveConflicts(); + transferLabelsToInventor(); + } - else if (field==_refineFld) - { - refineAll(); - transferLabelsToInventor(); - } + else if (field==_refineFld) + { + refineAll(); + transferLabelsToInventor(); + } - else if (field==_calculateFld) - { - initialPlacement(); - refineAll(); - transferLabelsToInventor(); - } + else if (field==_calculateFld) + { + initialPlacement(); + refineAll(); + transferLabelsToInventor(); + } - else if (field==_sliceFld) - { - _2dLabelsNode->clearLabels(); - if (_enableLabelingFld->getBoolValue()) - { - _currentSlice = _sliceFld->getIntValue(); - timerSensor->schedule(); - //initialPlacement(); - //refineAll(); - } - } + else if (field==_sliceFld) + { + _2dLabelsNode->clearLabels(); + if (_enableLabelingFld->getBoolValue()) + { + _currentSlice = _sliceFld->getIntValue(); + timerSensor->schedule(); + //initialPlacement(); + //refineAll(); + } + } - else if (field==_optFactorFld) - { - _optFactor = _optFactorFld->getIntValue(); - } + else if (field==_optFactorFld) + { + _optFactor = _optFactorFld->getIntValue(); + } - else if (field==_sendCSOFld) - { - _2dLabelsNode->setSendCSO(_sendCSOFld->getBoolValue()); - } + else if (field==_sendCSOFld) + { + _2dLabelsNode->setSendCSO(_sendCSOFld->getBoolValue()); + } } //---------------------------------------------------------------------------------- @@ -248,40 +248,40 @@ //---------------------------------------------------------------------------------- void METK2DLabeling::activateAttachments () { - ML_TRACE_IN("METK2DLabeling::activateAttachments ()"); + ML_TRACE_IN("METK2DLabeling::activateAttachments ()"); - clearAcceptedObjectIDs(); - addAcceptedObjectID("*"); - clearAcceptedInfoLayerNames(); - //addAcceptedInfoLayerName(LAY_APPEARANCE); - addAcceptedInfoLayerName("*"); + clearAcceptedObjectIDs(); + addAcceptedObjectID("*"); + clearAcceptedInfoLayerNames(); + //addAcceptedInfoLayerName(LAY_APPEARANCE); + addAcceptedInfoLayerName("*"); - sendNotification(); + sendNotification(); - // Don't forget to call the super class functionality, it enables field - // notifications for your module again. - // SUPER_CLASS is the class you derive from (usually BaseOp). - ObjMgrClient::activateAttachments(); + // Don't forget to call the super class functionality, it enables field + // notifications for your module again. + // SUPER_CLASS is the class you derive from (usually BaseOp). + ObjMgrClient::activateAttachments(); } void METK2DLabeling::handleObjMgrNotification() { - ML_TRACE_IN("METK2DLabeling::handleObjMgrNotification()"); + ML_TRACE_IN("METK2DLabeling::handleObjMgrNotification()"); - omEventContainer myEventList = getEventContainer(); + omEventContainer myEventList = getEventContainer(); - //Durchiterieren der EventList - omEventContainer::const_iterator iter; - for ( iter = myEventList.begin();iter!=myEventList.end(); iter++) - { - ObjMgrEvent myEvent = (*iter); + //Durchiterieren der EventList + omEventContainer::const_iterator iter; + for ( iter = myEventList.begin();iter!=myEventList.end(); iter++) + { + ObjMgrEvent myEvent = (*iter); - //Status has changed - //if (myEvent.infoID == INF_SURFACEDIST || myEvent.infoID == INF_VISIBLE || myEvent.infoID == INF_IVPOINTER) { - } - clearEventContainer(); + //Status has changed + //if (myEvent.infoID == INF_SURFACEDIST || myEvent.infoID == INF_VISIBLE || myEvent.infoID == INF_IVPOINTER) { + } + clearEventContainer(); } @@ -290,9 +290,9 @@ //---------------------------------------------------------------------------------- BaseOp::INPUT_HANDLE METK2DLabeling::handleInput(int /*inIndex*/, INPUT_STATE /*state*/) const { - ML_TRACE_IN("METK2DLabeling::handleInput ()"); + ML_TRACE_IN("METK2DLabeling::handleInput ()"); - return INVALIDATE; + return INVALIDATE; } //---------------------------------------------------------------------------------- @@ -300,29 +300,29 @@ //---------------------------------------------------------------------------------- void METK2DLabeling::calcOutImageProps (int /*outIndex*/) { - ML_TRACE_IN("METK2DLabeling::calcOutImageProps ()"); + ML_TRACE_IN("METK2DLabeling::calcOutImageProps ()"); - //std::cout << "METK2DLabeling::calcOutImageProps ()" << std::endl; - // Change properties of output image outIndex here whose - // defaults are inherited from the input image (if there is one). + //std::cout << "METK2DLabeling::calcOutImageProps ()" << std::endl; + // Change properties of output image outIndex here whose + // defaults are inherited from the input image (if there is one). - getOutImg()->setImgExt ( getInImg(0)->getImgExt() ); - getOutImg()->setPageExt ( getInImg(0)->getPageExt() ); + getOutImg()->setImgExt ( getInImg(0)->getImgExt() ); + getOutImg()->setPageExt ( getInImg(0)->getPageExt() ); - // Determine new min/max range. - long double min = -1000; - long double max = 1000; - getOutImg()->setMinVoxelValue( min ); - getOutImg()->setMaxVoxelValue( max ); + // Determine new min/max range. + long double min = -1000; + long double max = 1000; + getOutImg()->setMinVoxelValue( min ); + getOutImg()->setMaxVoxelValue( max ); - // Get data type which can hold the new data range correctly. Use signed types for ambiguous cases - // where both the unsigned and signed data types could hold the data range. E.g. range is 13 - 97 where - // unsigned and signed 8 bit integer both are well suited for that range. - MLDataType dt = MLGetDataTypeForRange(&min, &max, false); + // Get data type which can hold the new data range correctly. Use signed types for ambiguous cases + // where both the unsigned and signed data types could hold the data range. E.g. range is 13 - 97 where + // unsigned and signed 8 bit integer both are well suited for that range. + MLDataType dt = MLGetDataTypeForRange(&min, &max, false); - // Set found data type. If no one is found then invalidate output image. - if (MLIsValidType(dt)){ getOutImg()->setDataType(dt); } - else { getOutImg()->setOutOfDate(); return; } + // Set found data type. If no one is found then invalidate output image. + if (MLIsValidType(dt)){ getOutImg()->setDataType(dt); } + else { getOutImg()->setOutOfDate(); return; } } @@ -331,787 +331,787 @@ //---------------------------------------------------------------------------------- SubImgBox METK2DLabeling::calcInSubImageBox (int /*inIndex*/, const SubImgBox &outSubImgBox, int /*outIndex*/) { - ML_TRACE_IN("METK2DLabeling::calcInSubImageBox ()"); + ML_TRACE_IN("METK2DLabeling::calcInSubImageBox ()"); - // Return region of input image inIndex needed to compute region - // outSubImgBox of output image outIndex. - return outSubImgBox; + // Return region of input image inIndex needed to compute region + // outSubImgBox of output image outIndex. + return outSubImgBox; } //---------------------------------------------------------------------------------- -//! Called to determine properties props of input image region (tile) of input inIndex +//! Called to determine properties props of input image region (tile) of input inIndex //! required to calculate an output image region (page) of output outIndex. //---------------------------------------------------------------------------------- void METK2DLabeling::calcInSubImageProps(int /*inIndex*/, - InSubImageProps& /*props*/, - int /*outIndex*/) + InSubImageProps& /*props*/, + int /*outIndex*/) { - ML_TRACE_IN("METK2DLabeling::calcInSubImageProps ()"); + ML_TRACE_IN("METK2DLabeling::calcInSubImageProps ()"); } //---------------------------------------------------------------------------------- -//! Calls correctly typed (template) version of calcOutSubImage to calculate page +//! Calls correctly typed (template) version of calcOutSubImage to calculate page //! outSubImg of output image with index outSubImg. //---------------------------------------------------------------------------------- CALC_OUTSUBIMAGE1_CPP(METK2DLabeling); //---------------------------------------------------------------------------------- -//! Template for type specific page calculation. Called by +//! Template for type specific page calculation. Called by //! CALC_OUTSUBIMAGE1_CPP(METK2DLabeling). //---------------------------------------------------------------------------------- template <typename T> void METK2DLabeling::calcOutSubImage (TSubImg<T> *outSubImg, int outIndex - , TSubImg<T> *inSubImg0 - ) + , TSubImg<T> *inSubImg0 + ) { - ML_TRACE_IN("template <typename T> METK2DLabeling::calcOutSubImage ()"); - if (!getUpdatedInImg(0)) return; + ML_TRACE_IN("template <typename T> METK2DLabeling::calcOutSubImage ()"); + if (!getUpdatedInImg(0)) return; - if (_debugOutputFld->getEnumValue()==DOUT_NONE || - !_voxelValues || - !_componentIDs || - !_globalDistanceField || - !_textFreeSpaceHorizontalField[0] || - !_textFreeSpaceHorizontalField[1] || - !_tempFieldForLabelBoxes || - _debugStateFld->getEnumValue()==DSTATE_NONE) return; + if (_debugOutputFld->getEnumValue()==DOUT_NONE || + !_voxelValues || + !_componentIDs || + !_globalDistanceField || + !_textFreeSpaceHorizontalField[0] || + !_textFreeSpaceHorizontalField[1] || + !_tempFieldForLabelBoxes || + _debugStateFld->getEnumValue()==DSTATE_NONE) return; - // Compute subimage of output image outIndex from input subimages. + // Compute subimage of output image outIndex from input subimages. - // Clamp box of output image against image extent to avoid that unused areas are processed. - const SubImgBox validOutBox(outSubImg->getBox().intersect(getOutImg(outIndex)->getBoxFromImgExt())); + // Clamp box of output image against image extent to avoid that unused areas are processed. + const SubImgBox validOutBox(outSubImg->getBox().intersect(getOutImg(outIndex)->getBoxFromImgExt())); - _sliceSizeOrg = getUpdatedInImg(0)->getImgExt(); + _sliceSizeOrg = getUpdatedInImg(0)->getImgExt(); - switch (_debugOutputFld->getEnumValue()) - { - case DOUT_VOXEL: - getOutImg()->setMaxVoxelValue( _voxelValues->getMaxValue() ); - getOutImg()->setMinVoxelValue( _voxelValues->getMinValue() ); - break; - case DOUT_COMP: - getOutImg()->setMaxVoxelValue( _componentIDs->getMaxValue() ); - getOutImg()->setMinVoxelValue( _componentIDs->getMinValue() ); - break; - case DOUT_DISTANCE: - getOutImg()->setMaxVoxelValue( _globalDistanceField->getMaxValue() ); - getOutImg()->setMinVoxelValue( _globalDistanceField->getMinValue() ); - break; - case DOUT_TEXTH1: - getOutImg()->setMaxVoxelValue( _textFreeSpaceHorizontalField[0]->getMaxValue() ); - getOutImg()->setMinVoxelValue( _textFreeSpaceHorizontalField[0]->getMinValue() ); - break; - case DOUT_TEXTH2: - getOutImg()->setMaxVoxelValue( _textFreeSpaceHorizontalField[1]->getMaxValue() ); - getOutImg()->setMinVoxelValue( _textFreeSpaceHorizontalField[1]->getMinValue() ); - break; - case DOUT_FREESPACE: - getOutImg()->setMaxVoxelValue( 1 ); - getOutImg()->setMinVoxelValue( 0 ); - break; - case DOUT_LABELBOXES: - getOutImg()->setMaxVoxelValue( _tempFieldForLabelBoxes->getMaxValue() ); - getOutImg()->setMinVoxelValue( _tempFieldForLabelBoxes->getMinValue() ); - break; - } + switch (_debugOutputFld->getEnumValue()) + { + case DOUT_VOXEL: + getOutImg()->setMaxVoxelValue( _voxelValues->getMaxValue() ); + getOutImg()->setMinVoxelValue( _voxelValues->getMinValue() ); + break; + case DOUT_COMP: + getOutImg()->setMaxVoxelValue( _componentIDs->getMaxValue() ); + getOutImg()->setMinVoxelValue( _componentIDs->getMinValue() ); + break; + case DOUT_DISTANCE: + getOutImg()->setMaxVoxelValue( _globalDistanceField->getMaxValue() ); + getOutImg()->setMinVoxelValue( _globalDistanceField->getMinValue() ); + break; + case DOUT_TEXTH1: + getOutImg()->setMaxVoxelValue( _textFreeSpaceHorizontalField[0]->getMaxValue() ); + getOutImg()->setMinVoxelValue( _textFreeSpaceHorizontalField[0]->getMinValue() ); + break; + case DOUT_TEXTH2: + getOutImg()->setMaxVoxelValue( _textFreeSpaceHorizontalField[1]->getMaxValue() ); + getOutImg()->setMinVoxelValue( _textFreeSpaceHorizontalField[1]->getMinValue() ); + break; + case DOUT_FREESPACE: + getOutImg()->setMaxVoxelValue( 1 ); + getOutImg()->setMinVoxelValue( 0 ); + break; + case DOUT_LABELBOXES: + getOutImg()->setMaxVoxelValue( _tempFieldForLabelBoxes->getMaxValue() ); + getOutImg()->setMinVoxelValue( _tempFieldForLabelBoxes->getMinValue() ); + break; + } - // Process all voxels of the valid region of the output page. - Vector p; - long int valuePos; - int anchorNr; - for (p.u=validOutBox.v1.u; p.u<=validOutBox.v2.u; ++p.u){ - for (p.t=validOutBox.v1.t; p.t<=validOutBox.v2.t; ++p.t){ - for (p.c=validOutBox.v1.c; p.c<=validOutBox.v2.c; ++p.c){ - for (p.z=validOutBox.v1.z; p.z<=validOutBox.v2.z; ++p.z){ - for (p.y=validOutBox.v1.y; p.y<=validOutBox.v2.y; ++p.y){ + // Process all voxels of the valid region of the output page. + Vector p; + long int valuePos; + int anchorNr; + for (p.u=validOutBox.v1.u; p.u<=validOutBox.v2.u; ++p.u){ + for (p.t=validOutBox.v1.t; p.t<=validOutBox.v2.t; ++p.t){ + for (p.c=validOutBox.v1.c; p.c<=validOutBox.v2.c; ++p.c){ + for (p.z=validOutBox.v1.z; p.z<=validOutBox.v2.z; ++p.z){ + for (p.y=validOutBox.v1.y; p.y<=validOutBox.v2.y; ++p.y){ - p.x = validOutBox.v1.x; - // Get pointers to row starts of input and output subimages. - const T *in0Voxel = inSubImg0->getImgPos(p); - T *outVoxel = outSubImg->getImgPos(p); - const MLint rowEnd = validOutBox.v2.x; + p.x = validOutBox.v1.x; + // Get pointers to row starts of input and output subimages. + const T *in0Voxel = inSubImg0->getImgPos(p); + T *outVoxel = outSubImg->getImgPos(p); + const MLint rowEnd = validOutBox.v2.x; - // Process all row voxels. - for (; p.x <= rowEnd; ++p.x, ++in0Voxel, ++outVoxel){ - //*outVoxel = *in0Voxel; - //*outVoxel = p.y*p.z+p.x; - valuePos = (p.y/_optFactor)*(_sliceSizeOrg.x/_optFactor)+(p.x/_optFactor); - if (valuePos<_voxelValues->getSize()) - { - switch (_debugOutputFld->getEnumValue()) - { - case DOUT_VOXEL: - *outVoxel = (T)_voxelValues->getValueAt(valuePos); - break; - case DOUT_COMP: - *outVoxel = (T)_componentIDs->getValueAt(valuePos); - break; - case DOUT_DISTANCE: - *outVoxel = (T)_globalDistanceField->getValueAt(valuePos); - break; - case DOUT_ANCHORDIST: - anchorNr = _anchorPointInspectionFld->getIntValue(); - if (anchorNr<_components.size()) - if (_components[anchorNr].anchorDistanceField) - *outVoxel = (T)_components[anchorNr].anchorDistanceField->getValueAt(valuePos); - else - *outVoxel = 0; - break; - case DOUT_TEXTH1: - *outVoxel = (T)_textFreeSpaceHorizontalField[0]->getValueAt(valuePos); - break; - case DOUT_TEXTH2: - *outVoxel = (T)_textFreeSpaceHorizontalField[1]->getValueAt(valuePos); - break; - case DOUT_FREESPACE: - anchorNr = _anchorPointInspectionFld->getIntValue(); - if (anchorNr<_components.size()) - //if (_components[anchorNr].maxInnerDistance<-1*(_minCompSizeFld->getIntValue()/_optFactor)) //is valid - if (_components[anchorNr].valid) //is valid - if (_components[anchorNr].freeSpaceField) - *outVoxel = (T)_components[anchorNr].freeSpaceField->getValueAt(valuePos); - else - *outVoxel = 0; - else - *outVoxel = 0; - break; - case DOUT_LABELBOXES: - *outVoxel = (T)_tempFieldForLabelBoxes->getValueAt(valuePos); - break; + // Process all row voxels. + for (; p.x <= rowEnd; ++p.x, ++in0Voxel, ++outVoxel){ + //*outVoxel = *in0Voxel; + //*outVoxel = p.y*p.z+p.x; + valuePos = (p.y/_optFactor)*(_sliceSizeOrg.x/_optFactor)+(p.x/_optFactor); + if (valuePos<_voxelValues->getSize()) + { + switch (_debugOutputFld->getEnumValue()) + { + case DOUT_VOXEL: + *outVoxel = (T)_voxelValues->getValueAt(valuePos); + break; + case DOUT_COMP: + *outVoxel = (T)_componentIDs->getValueAt(valuePos); + break; + case DOUT_DISTANCE: + *outVoxel = (T)_globalDistanceField->getValueAt(valuePos); + break; + case DOUT_ANCHORDIST: + anchorNr = _anchorPointInspectionFld->getIntValue(); + if (anchorNr<_components.size()) + if (_components[anchorNr].anchorDistanceField) + *outVoxel = (T)_components[anchorNr].anchorDistanceField->getValueAt(valuePos); + else + *outVoxel = 0; + break; + case DOUT_TEXTH1: + *outVoxel = (T)_textFreeSpaceHorizontalField[0]->getValueAt(valuePos); + break; + case DOUT_TEXTH2: + *outVoxel = (T)_textFreeSpaceHorizontalField[1]->getValueAt(valuePos); + break; + case DOUT_FREESPACE: + anchorNr = _anchorPointInspectionFld->getIntValue(); + if (anchorNr<_components.size()) + //if (_components[anchorNr].maxInnerDistance<-1*(_minCompSizeFld->getIntValue()/_optFactor)) //is valid + if (_components[anchorNr].valid) //is valid + if (_components[anchorNr].freeSpaceField) + *outVoxel = (T)_components[anchorNr].freeSpaceField->getValueAt(valuePos); + else + *outVoxel = 0; + else + *outVoxel = 0; + break; + case DOUT_LABELBOXES: + *outVoxel = (T)_tempFieldForLabelBoxes->getValueAt(valuePos); + break; - default: - *outVoxel = 0; - } - } - else - *outVoxel = 12; - } - } - } - } - } - } + default: + *outVoxel = 0; + } + } + else + *outVoxel = 12; + } + } + } + } + } + } } void METK2DLabeling::initialPlacement() { - if (!getUpdatedInImg(0)) return; - MLDataType mlDt = getUpdatedInImg(0)->getDataType(); + if (!getUpdatedInImg(0)) return; + MLDataType mlDt = getUpdatedInImg(0)->getDataType(); - switch (mlDt) { - case MLint8Type: calculateLabels<MLint8>(mlDt); break; - case MLuint8Type: calculateLabels<MLuint8>(mlDt); break; - case MLint16Type: calculateLabels<MLint16>(mlDt); break; - case MLuint16Type: calculateLabels<MLuint16>(mlDt); break; - case MLint32Type: calculateLabels<MLint32>(mlDt); break; - case MLuint32Type: calculateLabels<MLuint32>(mlDt); break; - case MLint64Type: calculateLabels<MLint64>(mlDt); break; - case MLfloatType: calculateLabels<MLfloat>(mlDt); break; - case MLldoubleType: calculateLabels<MLldouble>(mlDt); break; - default: // using double was the default case as for now, so we keep it that way: - case MLdoubleType: calculateLabels<MLdouble>(mlDt); break; - } + switch (mlDt) { + case MLint8Type: calculateLabels<MLint8>(mlDt); break; + case MLuint8Type: calculateLabels<MLuint8>(mlDt); break; + case MLint16Type: calculateLabels<MLint16>(mlDt); break; + case MLuint16Type: calculateLabels<MLuint16>(mlDt); break; + case MLint32Type: calculateLabels<MLint32>(mlDt); break; + case MLuint32Type: calculateLabels<MLuint32>(mlDt); break; + case MLint64Type: calculateLabels<MLint64>(mlDt); break; + case MLfloatType: calculateLabels<MLfloat>(mlDt); break; + case MLldoubleType: calculateLabels<MLldouble>(mlDt); break; + default: // using double was the default case as for now, so we keep it that way: + case MLdoubleType: calculateLabels<MLdouble>(mlDt); break; + } } void METK2DLabeling::refineAll() { - //std::cout << "refineAll-start" << std::endl; - int iteration=0; - int conflicts = _labelConflicts.size(); - while (iteration<_maxConflictIterationsFld->getIntValue() && conflicts!=0) - { - conflicts = resolveConflicts(); - iteration++; - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "conflicts = " << conflicts << " iterations=" << iteration << std::endl; - } - //std::cout << "refineAll-stop" << std::endl; + //std::cout << "refineAll-start" << std::endl; + int iteration=0; + int conflicts = _labelConflicts.size(); + while (iteration<_maxConflictIterationsFld->getIntValue() && conflicts!=0) + { + conflicts = resolveConflicts(); + iteration++; + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "conflicts = " << conflicts << " iterations=" << iteration << std::endl; + } + //std::cout << "refineAll-stop" << std::endl; } template <typename DT> void METK2DLabeling::calculateLabels(MLDataType ML_DT) { - ML_TRACE_IN("void METK2DLabeling::calculateLabels()"); - if (!getUpdatedInImg(0)) return; + ML_TRACE_IN("void METK2DLabeling::calculateLabels()"); + if (!getUpdatedInImg(0)) return; - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "calculateLabels start" << std::endl; + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "calculateLabels start" << std::endl; - //std::cout << "01 start" << std::endl; + //std::cout << "01 start" << std::endl; - _sliceSizeOrg = getUpdatedInImg(0)->getImgExt(); - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "x=" << _sliceSizeOrg.x << " y=" << _sliceSizeOrg.y << " z=" << _sliceSizeOrg.z << std::endl; - _sliceSizeOpt.x = _sliceSizeOrg.x/_optFactor; _sliceSizeOpt.y = _sliceSizeOrg.y/_optFactor; //_sliceSizeOpt.z = _sliceSizeOrg.z/_optFactor; - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "optimized x=" << _sliceSizeOpt.x << " y=" << _sliceSizeOpt.y << " z=" << _sliceSizeOpt.z << std::endl; + _sliceSizeOrg = getUpdatedInImg(0)->getImgExt(); + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "x=" << _sliceSizeOrg.x << " y=" << _sliceSizeOrg.y << " z=" << _sliceSizeOrg.z << std::endl; + _sliceSizeOpt.x = _sliceSizeOrg.x/_optFactor; _sliceSizeOpt.y = _sliceSizeOrg.y/_optFactor; //_sliceSizeOpt.z = _sliceSizeOrg.z/_optFactor; + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "optimized x=" << _sliceSizeOpt.x << " y=" << _sliceSizeOpt.y << " z=" << _sliceSizeOpt.z << std::endl; - //Create Fields - //EVTL EIN DELETE NOCH VORHER!!!!! - if (_voxelValues) delete _voxelValues; - _voxelValues = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_additionalMask) delete _additionalMask; - if (_useAdditionalMaskFld->getBoolValue()) - _additionalMask = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_componentIDs) delete _componentIDs; - _componentIDs = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_globalDistanceField) delete _globalDistanceField; - _globalDistanceField = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_textFreeSpaceHorizontalField[0]) delete _textFreeSpaceHorizontalField[0]; - _textFreeSpaceHorizontalField[0] = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_textFreeSpaceHorizontalField[1]) delete _textFreeSpaceHorizontalField[1]; - _textFreeSpaceHorizontalField[1] = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - if (_tempFieldForLabelBoxes) delete _tempFieldForLabelBoxes; - _tempFieldForLabelBoxes = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + //Create Fields + //EVTL EIN DELETE NOCH VORHER!!!!! + if (_voxelValues) delete _voxelValues; + _voxelValues = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_additionalMask) delete _additionalMask; + if (_useAdditionalMaskFld->getBoolValue()) + _additionalMask = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_componentIDs) delete _componentIDs; + _componentIDs = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_globalDistanceField) delete _globalDistanceField; + _globalDistanceField = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_textFreeSpaceHorizontalField[0]) delete _textFreeSpaceHorizontalField[0]; + _textFreeSpaceHorizontalField[0] = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_textFreeSpaceHorizontalField[1]) delete _textFreeSpaceHorizontalField[1]; + _textFreeSpaceHorizontalField[1] = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + if (_tempFieldForLabelBoxes) delete _tempFieldForLabelBoxes; + _tempFieldForLabelBoxes = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - _componentIDs->fillWith(-1); - _globalDistanceField->fillWith(32000); - _textFreeSpaceHorizontalField[0]->fillWith(0); - _textFreeSpaceHorizontalField[1]->fillWith(0); - _tempFieldForLabelBoxes->fillWith(0); + _componentIDs->fillWith(-1); + _globalDistanceField->fillWith(32000); + _textFreeSpaceHorizontalField[0]->fillWith(0); + _textFreeSpaceHorizontalField[1]->fillWith(0); + _tempFieldForLabelBoxes->fillWith(0); - _labelLines.clear(); - _labelBoxes.clear(); - _labelConflicts.clear(); - _components.clear(); + _labelLines.clear(); + _labelBoxes.clear(); + _labelConflicts.clear(); + _components.clear(); - //std::cout << "02 start ObjMgr" << std::endl; - buildObjIDList(); - //std::cout << "03 stop ObjMgr" << std::endl; + //std::cout << "02 start ObjMgr" << std::endl; + buildObjIDList(); + //std::cout << "03 stop ObjMgr" << std::endl; - //Fill _voxelValues - SubImg mySubImg; - mySubImg.setBox(Vector(0,0,_sliceFld->getIntValue(),_sliceSizeOrg.x,_sliceSizeOrg.y,_sliceFld->getIntValue())); - mySubImg.setDataType(getInImg(0)->getDataType()); - int error = getUpdatedInImg(0)->getTile(mySubImg); - if (error!=0) - { - std::cout << "getUpdatedInImg(0)->getTile Error = " << MLGetErrorCodeDescription(error) << std::endl; - return; - } + //Fill _voxelValues + SubImg mySubImg; + mySubImg.setBox(Vector(0,0,_sliceFld->getIntValue(),_sliceSizeOrg.x,_sliceSizeOrg.y,_sliceFld->getIntValue())); + mySubImg.setDataType(getInImg(0)->getDataType()); + int error = getUpdatedInImg(0)->getTile(mySubImg); + if (error!=0) + { + std::cout << "getUpdatedInImg(0)->getTile Error = " << MLGetErrorCodeDescription(error) << std::endl; + return; + } - // Init the slice data pointer here since we want to reuse the allocated slice memory later. - void *sliceData = NULL; + // Init the slice data pointer here since we want to reuse the allocated slice memory later. + void *sliceData = NULL; - MLErrorCode err = getTile(getInOp(0), - getInOpIndex(0), - SubImgBox(Vector( 0, 0, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/), - Vector(_sliceSizeOrg.x-1, _sliceSizeOrg.y-1, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/)), - ML_DT, - &sliceData); + MLErrorCode err = getTile(getInOp(0), + getInOpIndex(0), + SubImgBox(Vector( 0, 0, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/), + Vector(_sliceSizeOrg.x-1, _sliceSizeOrg.y-1, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/)), + ML_DT, + &sliceData); - if (err!=0) - { - std::cout << "getTile Error = " << MLGetErrorCodeDescription(err) << std::endl; - return; - } + if (err!=0) + { + std::cout << "getTile Error = " << MLGetErrorCodeDescription(err) << std::endl; + return; + } - // Scan the slice value by value. - // get correctly typed pointer: - DT* slice = (DT*) sliceData; - for (MLint y = 0; y < _sliceSizeOrg.y-_optFactor; /*y++*/y=y+_optFactor) - { - const MLint rowStart = _sliceSizeOrg.x * y; - DT* row = &slice[rowStart]; - for (MLint x = 0; x < _sliceSizeOrg.x-_optFactor; /*x++*/x=x+_optFactor) - { - // Get value from image. - row = row+_optFactor; - const DT voxelValue = *row; - _voxelValues->setValueAt(x/_optFactor,y/_optFactor,voxelValue); - } - } + // Scan the slice value by value. + // get correctly typed pointer: + DT* slice = (DT*) sliceData; + for (MLint y = 0; y < _sliceSizeOrg.y-_optFactor; /*y++*/y=y+_optFactor) + { + const MLint rowStart = _sliceSizeOrg.x * y; + DT* row = &slice[rowStart]; + for (MLint x = 0; x < _sliceSizeOrg.x-_optFactor; /*x++*/x=x+_optFactor) + { + // Get value from image. + row = row+_optFactor; + const DT voxelValue = *row; + _voxelValues->setValueAt(x/_optFactor,y/_optFactor,voxelValue); + } + } - // Release the allocated memory. - if (sliceData){ - freeTile(sliceData); - sliceData = NULL; - } + // Release the allocated memory. + if (sliceData){ + freeTile(sliceData); + sliceData = NULL; + } - //Fill _additionalMask - if (_useAdditionalMaskFld->getBoolValue() && - getUpdatedInImg(1)) - { - if (getUpdatedInImg(0)->getDataType()==getUpdatedInImg(1)->getDataType() && - getUpdatedInImg(0)->getImgExt()==getUpdatedInImg(1)->getImgExt()) - { - mySubImg.setBox(Vector(0,0,_sliceFld->getIntValue(),_sliceSizeOrg.x,_sliceSizeOrg.y,_sliceFld->getIntValue())); - mySubImg.setDataType(getInImg(1)->getDataType()); - error = getUpdatedInImg(1)->getTile(mySubImg); - if (error!=0) - { - std::cout << "getUpdatedInImg(1)->getTile Error = " << MLGetErrorCodeDescription(error) << std::endl; - return; - } + //Fill _additionalMask + if (_useAdditionalMaskFld->getBoolValue() && + getUpdatedInImg(1)) + { + if (getUpdatedInImg(0)->getDataType()==getUpdatedInImg(1)->getDataType() && + getUpdatedInImg(0)->getImgExt()==getUpdatedInImg(1)->getImgExt()) + { + mySubImg.setBox(Vector(0,0,_sliceFld->getIntValue(),_sliceSizeOrg.x,_sliceSizeOrg.y,_sliceFld->getIntValue())); + mySubImg.setDataType(getInImg(1)->getDataType()); + error = getUpdatedInImg(1)->getTile(mySubImg); + if (error!=0) + { + std::cout << "getUpdatedInImg(1)->getTile Error = " << MLGetErrorCodeDescription(error) << std::endl; + return; + } - // Init the slice data pointer here since we want to reuse the allocated slice memory later. - sliceData = NULL; + // Init the slice data pointer here since we want to reuse the allocated slice memory later. + sliceData = NULL; - err = getTile(getInOp(1), - getInOpIndex(1), - SubImgBox(Vector( 0, 0, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/), - Vector(_sliceSizeOrg.x-1, _sliceSizeOrg.y-1, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/)), - ML_DT, - &sliceData); + err = getTile(getInOp(1), + getInOpIndex(1), + SubImgBox(Vector( 0, 0, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/), + Vector(_sliceSizeOrg.x-1, _sliceSizeOrg.y-1, _sliceFld->getIntValue(), 0 /*c*/, 0 /*t*/ , 0 /*u*/)), + ML_DT, + &sliceData); - if (err!=0) - { - std::cout << "getTile Error = " << MLGetErrorCodeDescription(err) << std::endl; - return; - } + if (err!=0) + { + std::cout << "getTile Error = " << MLGetErrorCodeDescription(err) << std::endl; + return; + } - // Scan the slice value by value. - // get correctly typed pointer: - slice = (DT*) sliceData; - for (MLint y = 0; y < _sliceSizeOrg.y-_optFactor; /*y++*/y=y+_optFactor) - { - const MLint rowStart = _sliceSizeOrg.x * y; - DT* row = &slice[rowStart]; - for (MLint x = 0; x < _sliceSizeOrg.x-_optFactor; /*x++*/x=x+_optFactor) - { - // Get value from image. - row = row+_optFactor; - const DT voxelValue = *row; - _additionalMask->setValueAt(x/_optFactor,y/_optFactor,voxelValue); - } - } + // Scan the slice value by value. + // get correctly typed pointer: + slice = (DT*) sliceData; + for (MLint y = 0; y < _sliceSizeOrg.y-_optFactor; /*y++*/y=y+_optFactor) + { + const MLint rowStart = _sliceSizeOrg.x * y; + DT* row = &slice[rowStart]; + for (MLint x = 0; x < _sliceSizeOrg.x-_optFactor; /*x++*/x=x+_optFactor) + { + // Get value from image. + row = row+_optFactor; + const DT voxelValue = *row; + _additionalMask->setValueAt(x/_optFactor,y/_optFactor,voxelValue); + } + } - // Release the allocated memory. - if (sliceData){ - freeTile(sliceData); - sliceData = NULL; - } - } - else - { - std::cout << "Labeling error: Additional mask has not the same data type as MCSM or not the same image dimensions!" << std::endl; - delete _additionalMask; - _additionalMask = NULL; - } - } - else - { - delete _additionalMask; - _additionalMask = NULL; - } - + // Release the allocated memory. + if (sliceData){ + freeTile(sliceData); + sliceData = NULL; + } + } + else + { + std::cout << "Labeling error: Additional mask has not the same data type as MCSM or not the same image dimensions!" << std::endl; + delete _additionalMask; + _additionalMask = NULL; + } + } + else + { + delete _additionalMask; + _additionalMask = NULL; + } - int compCount; - //std::cout << "04 start calcConnectedComp" << std::endl; - compCount = calcConnectedComp(); - //std::cout << "05 stop calcConnectedComp" << std::endl; - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "compCount=" << compCount << std::endl; - for (MLint i=0; i<_components.size(); i++) - { - _components[i].maxInnerDistance=1; - //_components[i].labelText = "Component "+kBasics::IntToString(i)+"\n Subtitle abc"; - if (_components[i].valid) - { - myObjMgr->getObjAttributeString(_components[i].objectID,LAY_LABEL,INF_LABELTEXT,_components[i].labelText); - _2dLabelsNode->getTextDimension(_components[i].labelText,_components[i].textSize.x,_components[i].textSize.y,_optFactor); - _components[i].totalSize.x = _components[i].textSize.x+2*(_borderDistanceFld->getIntValue()/_optFactor); - _components[i].totalSize.y = _components[i].textSize.y+2*(_borderDistanceFld->getIntValue()/_optFactor); - _components[i].anchorDistanceField = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); - } - else - { - _components[i].labelText=""; - _components[i].anchorDistanceField = NULL; - } - - _components[i].freeSpaceField = NULL; - _components[i].parentID=-1; - _components[i].groupID=-1; - //_components[i].objectID=1; //LATER: real Object ID for grouping - } + int compCount; + //std::cout << "04 start calcConnectedComp" << std::endl; + compCount = calcConnectedComp(); + //std::cout << "05 stop calcConnectedComp" << std::endl; + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "compCount=" << compCount << std::endl; + for (MLint i=0; i<_components.size(); i++) + { + _components[i].maxInnerDistance=1; + //_components[i].labelText = "Component "+kBasics::IntToString(i)+"\n Subtitle abc"; + if (_components[i].valid) + { + myObjMgr->getObjAttributeString(_components[i].objectID,LAY_LABEL,INF_LABELTEXT,_components[i].labelText); + _2dLabelsNode->getTextDimension(_components[i].labelText,_components[i].textSize.x,_components[i].textSize.y,_optFactor); + _components[i].totalSize.x = _components[i].textSize.x+2*(_borderDistanceFld->getIntValue()/_optFactor); + _components[i].totalSize.y = _components[i].textSize.y+2*(_borderDistanceFld->getIntValue()/_optFactor); + _components[i].anchorDistanceField = new labField(_sliceSizeOpt.x,_sliceSizeOpt.y); + } + else + { + _components[i].labelText=""; + _components[i].anchorDistanceField = NULL; + } - //!!ACHTUNG - //_globalDistanceField wird derzeit nirgendwo genutzt!!! - //Aber weitere Berechnungen in dieser Funktion schon - calcGlobalDistanceField(); + _components[i].freeSpaceField = NULL; + _components[i].parentID=-1; + _components[i].groupID=-1; + //_components[i].objectID=1; //LATER: real Object ID for grouping + } - calcGroups(); - calcAnchorPointDistances(); + //!!ACHTUNG + //_globalDistanceField wird derzeit nirgendwo genutzt!!! + //Aber weitere Berechnungen in dieser Funktion schon + calcGlobalDistanceField(); - //std::cout << "xxx" << std::endl; - calcFreeSpace(); + calcGroups(); - _labelConflicts.clear(); + calcAnchorPointDistances(); - //std::cout << "yyy" << std::endl; - calcTextPos(); //Dauert wohl sehr lange + //std::cout << "xxx" << std::endl; + calcFreeSpace(); - //transferLabelsToInventor(); + _labelConflicts.clear(); - if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "calculateLabels end" << std::endl; - //std::cout << "05 stop calcLabels" << std::endl; + //std::cout << "yyy" << std::endl; + calcTextPos(); //Dauert wohl sehr lange + + //transferLabelsToInventor(); + + if (_debugStateFld->getEnumValue()==DSTATE_ALL) std::cout << "calculateLabels end" << std::endl; + //std::cout << "05 stop calcLabels" << std::endl; } int METK2DLabeling::calcConnectedComp() { - ML_TRACE_IN("void METK2DLabeling::calcConnectedComp()"); + ML_TRACE_IN("void METK2DLabeling::calcConnectedComp()"); - //Calculate the connected components - multimap<int,int> voxelToWatch; - unsigned long int pos; - multimap<int,int>::iterator tempVoxel; - int currentCompID=0; - int tempX,tempY; - string currentObjID; - for (unsigned int i=0; i<_sliceSizeOpt.x; i++) - { - for (unsigned int j=0; j<_sliceSizeOpt.y; j++) - { - pos = j*_sliceSizeOpt.x+i; - if (_componentIDs->getValueAt(pos)==-1.0) - { - currentCompID++; - _components.resize(currentCompID+1); - //currentObjID=_voxelValues->getValueAt(pos); - currentObjID = _voxelValObjID[_voxelValues->getValueAt(pos)]; - _components[currentCompID].objectID=currentObjID; - _components[currentCompID].voxelCount=0; - double* tempTransp = _htObjIDTransp.find(currentObjID); - if (tempTransp) - { - if (*tempTransp<_transpThresholdFld->getDoubleValue()) - { - _components[currentCompID].importanceLayer=0; - } - else _components[currentCompID].importanceLayer=1; - } - else _components[currentCompID].importanceLayer=0; + //Calculate the connected components + multimap<int,int> voxelToWatch; + unsigned long int pos; + multimap<int,int>::iterator tempVoxel; + int currentCompID=0; + int tempX,tempY; + string currentObjID; + for (unsigned int i=0; i<_sliceSizeOpt.x; i++) + { + for (unsigned int j=0; j<_sliceSizeOpt.y; j++) + { + pos = j*_sliceSizeOpt.x+i; + if (_componentIDs->getValueAt(pos)==-1.0) + { + currentCompID++; + _components.resize(currentCompID+1); + //currentObjID=_voxelValues->getValueAt(pos); + currentObjID = _voxelValObjID[_voxelValues->getValueAt(pos)]; + _components[currentCompID].objectID=currentObjID; + _components[currentCompID].voxelCount=0; + double* tempTransp = _htObjIDTransp.find(currentObjID); + if (tempTransp) + { + if (*tempTransp<_transpThresholdFld->getDoubleValue()) + { + _components[currentCompID].importanceLayer=0; + } + else _components[currentCompID].importanceLayer=1; + } + else _components[currentCompID].importanceLayer=0; - //Find neigbourhs - voxelToWatch.clear(); - voxelToWatch.insert(pair<int,int>(i,j)); - while (voxelToWatch.size()>0) - { - //pop first voxel - tempVoxel = voxelToWatch.begin(); - tempX=(int)tempVoxel->first; - tempY=(int)tempVoxel->second; - pos = tempY*_sliceSizeOpt.x+tempX; - voxelToWatch.erase(voxelToWatch.begin()); + //Find neigbourhs + voxelToWatch.clear(); + voxelToWatch.insert(pair<int,int>(i,j)); + while (voxelToWatch.size()>0) + { + //pop first voxel + tempVoxel = voxelToWatch.begin(); + tempX=(int)tempVoxel->first; + tempY=(int)tempVoxel->second; + pos = tempY*_sliceSizeOpt.x+tempX; + voxelToWatch.erase(voxelToWatch.begin()); - if (_componentIDs->getValueAt(pos)==-1.0) - { - if (tempX<_sliceSizeOpt.x-1) - //if (_voxelValues->getValueAt(pos+1)==currentObjID) - if (_voxelValObjID[_voxelValues->getValueAt(pos+1)]==currentObjID - && _componentIDs->getValueAt(pos+1)==-1.0) - voxelToWatch.insert(pair<int,int>(tempX+1,tempY)); + if (_componentIDs->getValueAt(pos)==-1.0) + { + if (tempX<_sliceSizeOpt.x-1) + //if (_voxelValues->getValueAt(pos+1)==currentObjID) + if (_voxelValObjID[_voxelValues->getValueAt(pos+1)]==currentObjID + && _componentIDs->getValueAt(pos+1)==-1.0) + voxelToWatch.insert(pair<int,int>(tempX+1,tempY)); - if (tempX>0) - //if (_voxelValues->getValueAt(pos-1)==currentObjID) - if (_voxelValObjID[_voxelValues->getValueAt(pos-1)]==currentObjID - && _componentIDs->getValueAt(pos-1)==-1.0) - voxelToWatch.insert(pair<int,int>(tempX-1,tempY)); + if (tempX>0) + //if (_voxelValues->getValueAt(pos-1)==currentObjID) + if (_voxelValObjID[_voxelValues->getValueAt(pos-1)]==currentObjID + && _componentIDs->getValueAt(pos-1)==-1.0) + voxelToWatch.insert(pair<int,int>(tempX-1,tempY)); - if (tempY<_sliceSizeOpt.y-1) - //if (_voxelValues->getValueAt(pos+_sliceSizeOpt.x)==currentObjID) - if (_voxelValObjID[_voxelValues->getValueAt(pos+_sliceSizeOpt.x)]==currentObjID - && _componentIDs->getValueAt(pos+_sliceSizeOpt.x)==-1.0) - voxelToWatch.insert(pair<int,int>(tempX,tempY+1)); + if (tempY<_sliceSizeOpt.y-1) + //if (_voxelValues->getValueAt(pos+_sliceSizeOpt.x)==currentObjID) + if (_voxelValObjID[_voxelValues->getValueAt(pos+_sliceSizeOpt.x)]==currentObjID + && _componentIDs->getValueAt(pos+_sliceSizeOpt.x)==-1.0) + voxelToWatch.insert(pair<int,int>(tempX,tempY+1)); - if (tempY>0) - //if (_voxelValues->getValueAt(pos-_sliceSizeOpt.x)==currentObjID) - if (_voxelValObjID[_voxelValues->getValueAt(pos-_sliceSizeOpt.x)]==currentObjID - && _componentIDs->getValueAt(pos-_sliceSizeOpt.x)==-1.0) - voxelToWatch.insert(pair<int,int>(tempX,tempY-1)); + if (tempY>0) + //if (_voxelValues->getValueAt(pos-_sliceSizeOpt.x)==currentObjID) + if (_voxelValObjID[_voxelValues->getValueAt(pos-_sliceSizeOpt.x)]==currentObjID + && _componentIDs->getValueAt(pos-_sliceSizeOpt.x)==-1.0) + voxelToWatch.insert(pair<int,int>(tempX,tempY-1)); - } - /* alte bones test variante - if (_voxelValues->getValueAt(pos)==0) - { - _componentIDs->setValueAt(pos,0); - } - else - { - _componentIDs->setValueAt(pos,currentCompID); - } - */ - - if (currentObjID=="") - { - _componentIDs->setValueAt(pos,0); - } - else - { - int oldValue = _componentIDs->getValueAt(pos); - if (oldValue!=currentCompID) - { - _componentIDs->setValueAt(pos,currentCompID); - _components[currentCompID].voxelCount++; - if (oldValue>=0) _components[oldValue].voxelCount--; - } - } - } - } - } - } + } + /* alte bones test variante + if (_voxelValues->getValueAt(pos)==0) + { + _componentIDs->setValueAt(pos,0); + } + else + { + _componentIDs->setValueAt(pos,currentCompID); + } + */ - //Set valid or not - for (unsigned int i=0; i<_components.size(); i++) - { - if (_components[i].voxelCount>0 && - _components[i].voxelCount*_optFactor*_optFactor>=_minCompSizeFld->getIntValue() && - _components[i].objectID!="") - { - bool labelOn; - myObjMgr->getObjAttributeBool(_components[i].objectID,LAY_LABEL,INF_LABELON,labelOn); - if (labelOn) - _components[i].valid=true; - else - _components[i].valid=false; - } - else _components[i].valid=false; - } + if (currentObjID=="") + { + _componentIDs->setValueAt(pos,0); + } + else + { + int oldValue = _componentIDs->getValueAt(pos); + if (oldValue!=currentCompID) + { + _componentIDs->setValueAt(pos,currentCompID); + _components[currentCompID].voxelCount++; + if (oldValue>=0) _components[oldValue].voxelCount--; + } + } + } + } + } + } - return currentCompID; + //Set valid or not + for (unsigned int i=0; i<_components.size(); i++) + { + if (_components[i].voxelCount>0 && + _components[i].voxelCount*_optFactor*_optFactor>=_minCompSizeFld->getIntValue() && + _components[i].objectID!="") + { + bool labelOn; + myObjMgr->getObjAttributeBool(_components[i].objectID,LAY_LABEL,INF_LABELON,labelOn); + if (labelOn) + _components[i].valid=true; + else + _components[i].valid=false; + } + else _components[i].valid=false; + } + + return currentCompID; } void METK2DLabeling::calcGlobalDistanceField() { - ML_TRACE_IN("void METK2DLabeling::calcGlobalDistanceField()"); + ML_TRACE_IN("void METK2DLabeling::calcGlobalDistanceField()"); - //Create distance field - //First only for background or not - unsigned long int pos; - int a,b,c,d; - int currentDistance = 0; - int currentComponentID; - for (unsigned int i=1; i<_sliceSizeOpt.x-1; i++) //Rand lassen - { - for (unsigned int j=1; j<_sliceSizeOpt.y-1; j++) //Rand lassen - { - pos = j*_sliceSizeOpt.x+i; - currentDistance = _globalDistanceField->getValueAt(pos); - a=_globalDistanceField->getValueAt(pos-1); - b=_globalDistanceField->getValueAt(pos+1); - c=_globalDistanceField->getValueAt(pos-_sliceSizeOpt.x); - d=_globalDistanceField->getValueAt(pos+_sliceSizeOpt.x); - currentComponentID = _componentIDs->getValueAt(i,j); + //Create distance field + //First only for background or not + unsigned long int pos; + int a,b,c,d; + int currentDistance = 0; + int currentComponentID; + for (unsigned int i=1; i<_sliceSizeOpt.x-1; i++) //Rand lassen + { + for (unsigned int j=1; j<_sliceSizeOpt.y-1; j++) //Rand lassen + { + pos = j*_sliceSizeO... [truncated message content] |
From: <wol...@us...> - 2009-06-23 06:17:32
|
Revision: 100 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=100&view=rev Author: wolfspindler Date: 2009-06-23 06:16:09 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Missing include of float.h added. Modified Paths: -------------- trunk/Community/METK/Sources/ML/METK2DLabeling/labField.cpp Modified: trunk/Community/METK/Sources/ML/METK2DLabeling/labField.cpp =================================================================== --- trunk/Community/METK/Sources/ML/METK2DLabeling/labField.cpp 2009-06-23 06:14:20 UTC (rev 99) +++ trunk/Community/METK/Sources/ML/METK2DLabeling/labField.cpp 2009-06-23 06:16:09 UTC (rev 100) @@ -4,6 +4,11 @@ //#define max(a,b) a<b?b:a #include <iostream> +#ifndef WIN32 + #include <float.h> +#endif + + using namespace std; //CTOR---------------------------------------------------------------------------------------------------- @@ -11,9 +16,9 @@ //-------------------------------------------------------------------------------------------------------- labField::labField( ) { - _fData = NULL; - _usedStandardCtor = true; - /*_isFirstValue = true;*/ + _fData = NULL; + _usedStandardCtor = true; + /*_isFirstValue = true;*/ } @@ -22,32 +27,32 @@ //-------------------------------------------------------------------------------------------------------- labField::labField(unsigned int iSizeX, unsigned int iSizeY) { - _fData = NULL; - _usedStandardCtor = false; - try - { - if ( iSizeX < 1 || iSizeY<1 ) - throw "labField::initial field size can not be zero!"; + _fData = NULL; + _usedStandardCtor = false; + try + { + if ( iSizeX < 1 || iSizeY<1 ) + throw "labField::initial field size can not be zero!"; - _fData = new float[iSizeX*iSizeY]; + _fData = new float[iSizeX*iSizeY]; - if ( _fData == NULL ) - throw "labField::memory allocation failed!"; - else - { - _iSizeX = iSizeX; _iSizeY = iSizeY; - _iSize = iSizeX*iSizeY; - fillWith( 0.0 ); - _minValue = _maxValue = 0; - _minPos = _maxPos = _iSize - 1; - } - } - catch( char * str ) - { - cout << "ERROR: " << str << endl; - } - //_usedStandardCtor = false; - _isFirstValue = true; + if ( _fData == NULL ) + throw "labField::memory allocation failed!"; + else + { + _iSizeX = iSizeX; _iSizeY = iSizeY; + _iSize = iSizeX*iSizeY; + fillWith( 0.0 ); + _minValue = _maxValue = 0; + _minPos = _maxPos = _iSize - 1; + } + } + catch( char * str ) + { + cout << "ERROR: " << str << endl; + } + //_usedStandardCtor = false; + _isFirstValue = true; } @@ -55,41 +60,41 @@ int labField::set( labField* oField ) { - if (_usedStandardCtor) return 0; - if (!oField) return 0; - try - { - _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); - _minPos = _maxPos = 0; - if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; - float* _tempData = oField->get_fData(); - for ( unsigned int i = 0; i < _iSize; i++ ) - { - //setValueAt(i, oField->getValueAt(i) ); - //Write directly from pointer to pointer - _fData[i] = _tempData[i]; - } - _scanMinMax(); - } - catch (char *str) - { - std::cout << "ERROR: " << str << std::endl; - return 0; - } - return 1; + if (_usedStandardCtor) return 0; + if (!oField) return 0; + try + { + _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); + _minPos = _maxPos = 0; + if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; + float* _tempData = oField->get_fData(); + for ( unsigned int i = 0; i < _iSize; i++ ) + { + //setValueAt(i, oField->getValueAt(i) ); + //Write directly from pointer to pointer + _fData[i] = _tempData[i]; + } + _scanMinMax(); + } + catch (char *str) + { + std::cout << "ERROR: " << str << std::endl; + return 0; + } + return 1; } labField::~labField() { - if (_usedStandardCtor) return; - try - { - delete[] _fData; - } - catch ( char *str ) - { - cout << "ERROR: " << str << endl; - } + if (_usedStandardCtor) return; + try + { + delete[] _fData; + } + catch ( char *str ) + { + cout << "ERROR: " << str << endl; + } } //FILL_WITH----------------------------------------------------------------------------------------------- @@ -97,21 +102,21 @@ //-------------------------------------------------------------------------------------------------------- int labField::fillWith(float fValue) { - if (_usedStandardCtor) return 0; - try - { - for ( unsigned int i = 0; i < _iSize; i++ ) - _fData[i] = fValue; - } - catch( char *str ) - { - cout << "ERROR: " << str << endl; - return 0; - } - _minValue = _maxValue = fValue; - _minPos = _maxPos = _iSize - 1; + if (_usedStandardCtor) return 0; + try + { + for ( unsigned int i = 0; i < _iSize; i++ ) + _fData[i] = fValue; + } + catch( char *str ) + { + cout << "ERROR: " << str << endl; + return 0; + } + _minValue = _maxValue = fValue; + _minPos = _maxPos = _iSize - 1; - return 1; + return 1; } @@ -120,36 +125,36 @@ //-------------------------------------------------------------------------------------------------------- int labField::setValueAt(unsigned int iPos, float fValue) { - if (_usedStandardCtor) return 0; - try - { - if (iPos >= ( unsigned int ) _iSize) throw "labField:: (set) out of field bounds!"; - if (_isFirstValue) - { - _minValue = _maxValue = fValue; //ACHTUNG: dirty hack - _minPos = _maxPos = iPos; //sp\xE4ter: min/max global \xFCberpr\xFCfen - _isFirstValue = false; - } - _fData[iPos] = fValue; + if (_usedStandardCtor) return 0; + try + { + if (iPos >= ( unsigned int ) _iSize) throw "labField:: (set) out of field bounds!"; + if (_isFirstValue) + { + _minValue = _maxValue = fValue; //ACHTUNG: dirty hack + _minPos = _maxPos = iPos; //sp\xE4ter: min/max global \xFCberpr\xFCfen + _isFirstValue = false; + } + _fData[iPos] = fValue; - if ( fValue > _maxValue ) - { - _maxValue = fValue; - _maxPos = iPos; - } + if ( fValue > _maxValue ) + { + _maxValue = fValue; + _maxPos = iPos; + } - if ( fValue < _minValue ) - { - _minValue = fValue; - _minPos = iPos; - } - } - catch ( char *str ) - { - cout << "ERROR: " << str << endl; - return 0; - } - return 1; + if ( fValue < _minValue ) + { + _minValue = fValue; + _minPos = iPos; + } + } + catch ( char *str ) + { + cout << "ERROR: " << str << endl; + return 0; + } + return 1; } @@ -158,37 +163,37 @@ //-------------------------------------------------------------------------------------------------------- int labField::setValueAt(unsigned int iX, unsigned int iY, float fValue) { - if (_usedStandardCtor) return 0; - unsigned int iPos = iY*_iSizeX+iX; - try - { - if (iPos >= ( unsigned int ) _iSize) throw "labField:: (set) out of field bounds!"; - if (_isFirstValue) - { - _minValue = _maxValue = fValue; //ACHTUNG: dirty hack - _minPos = _maxPos = iPos; //sp\xE4ter: min/max global \xFCberpr\xFCfen - _isFirstValue = false; - } - _fData[iPos] = fValue; + if (_usedStandardCtor) return 0; + unsigned int iPos = iY*_iSizeX+iX; + try + { + if (iPos >= ( unsigned int ) _iSize) throw "labField:: (set) out of field bounds!"; + if (_isFirstValue) + { + _minValue = _maxValue = fValue; //ACHTUNG: dirty hack + _minPos = _maxPos = iPos; //sp\xE4ter: min/max global \xFCberpr\xFCfen + _isFirstValue = false; + } + _fData[iPos] = fValue; - if ( fValue > _maxValue ) - { - _maxValue = fValue; - _maxPos = iPos; - } + if ( fValue > _maxValue ) + { + _maxValue = fValue; + _maxPos = iPos; + } - if ( fValue < _minValue ) - { - _minValue = fValue; - _minPos = iPos; - } - } - catch ( char *str ) - { - cout << "ERROR: " << str << endl; - return 0; - } - return 1; + if ( fValue < _minValue ) + { + _minValue = fValue; + _minPos = iPos; + } + } + catch ( char *str ) + { + cout << "ERROR: " << str << endl; + return 0; + } + return 1; } @@ -197,18 +202,18 @@ //-------------------------------------------------------------------------------------------------------- float labField::getValueAt ( unsigned int iPos ) const { - if (_usedStandardCtor) return 0; - try - { - if ( iPos >= ( unsigned int ) _iSize ) - throw "labField:: (get) out of field bounds!"; - return _fData[iPos]; - } - catch ( char *str ) - { - cout << "ERROR: " << str << endl; - return 0; - } + if (_usedStandardCtor) return 0; + try + { + if ( iPos >= ( unsigned int ) _iSize ) + throw "labField:: (get) out of field bounds!"; + return _fData[iPos]; + } + catch ( char *str ) + { + cout << "ERROR: " << str << endl; + return 0; + } } @@ -217,45 +222,45 @@ //-------------------------------------------------------------------------------------------------------- float labField::getValueAt ( unsigned int iX, unsigned int iY ) const { - if (_usedStandardCtor) return 0; - unsigned int iPos = iY*_iSizeX+iX; - try - { - if ( iPos >= ( unsigned int ) _iSize ) - throw "labField:: (get) out of field bounds!"; - return _fData[iPos]; - } - catch ( char *str ) - { - cout << "ERROR: " << str << endl; - return 0; - } + if (_usedStandardCtor) return 0; + unsigned int iPos = iY*_iSizeX+iX; + try + { + if ( iPos >= ( unsigned int ) _iSize ) + throw "labField:: (get) out of field bounds!"; + return _fData[iPos]; + } + catch ( char *str ) + { + cout << "ERROR: " << str << endl; + return 0; + } } //NORMALIZE----------------------------------------------------------------------------------------------- -/*! Ein Feld mit homogenen Werten wird auf \c 0 gesetzt. Schlaegt die Operation fehl, wird \c 0 +/*! Ein Feld mit homogenen Werten wird auf \c 0 gesetzt. Schlaegt die Operation fehl, wird \c 0 zurueckgegeben, ansonsten \c 1. */ //-------------------------------------------------------------------------------------------------------- int labField::normalize ( void ) { - if (_usedStandardCtor) return 0; - _scanMinMax(); - float fRange = _maxValue - _minValue; - if (fRange == 0) fRange = 1; - try - { - for (unsigned int i = 0; i < _iSize; i++) - _fData[i] = (_fData[i] - _minValue) / fRange; - } - catch ( char *str ) - { - cout<< "ERROR: " << str << endl; - return 0; - } - _minValue = 0; - _maxValue = 1.0; - return 1; + if (_usedStandardCtor) return 0; + _scanMinMax(); + float fRange = _maxValue - _minValue; + if (fRange == 0) fRange = 1; + try + { + for (unsigned int i = 0; i < _iSize; i++) + _fData[i] = (_fData[i] - _minValue) / fRange; + } + catch ( char *str ) + { + cout<< "ERROR: " << str << endl; + return 0; + } + _minValue = 0; + _maxValue = 1.0; + return 1; } @@ -264,7 +269,7 @@ //-------------------------------------------------------------------------------------------------------- float labField::getMinValue ( void ) const { - return _minValue; + return _minValue; } //GET_MAX_VALUE------------------------------------------------------------------------------------------- @@ -272,7 +277,7 @@ //-------------------------------------------------------------------------------------------------------- float labField::getMaxValue ( void ) const { - return _maxValue; + return _maxValue; } //GET_MIN_POS--------------------------------------------------------------------------------------------- @@ -280,7 +285,7 @@ //-------------------------------------------------------------------------------------------------------- int labField::getMinPos ( void ) const { - return _minPos; + return _minPos; } //GET_MAX_POS--------------------------------------------------------------------------------------------- @@ -288,94 +293,94 @@ //-------------------------------------------------------------------------------------------------------- int labField::getMaxPos ( void ) const { - return _maxPos; + return _maxPos; } //INVERT-------------------------------------------------------------------------------------------------- -/*! Auch Felder die nicht auf den Bereich von \c 0 bis \c 1 skaliert sind koennen invertiert werden. +/*! Auch Felder die nicht auf den Bereich von \c 0 bis \c 1 skaliert sind koennen invertiert werden. Schlaegt die Operation fehl, wird \c 0 zurueckgegeben, ansonsten \c 1. */ //-------------------------------------------------------------------------------------------------------- int labField::invert ( void ) { - if (_usedStandardCtor) return 0; - float fRange = _maxValue - _minValue; - try - { - for ( unsigned int i = 0; i < _iSize; i++ ) - _fData[i] = fRange - _fData[i] + 2 * _minValue; - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } - int iTemp = _minPos; - _minPos = _maxPos; - _maxPos = iTemp; - return 1; + if (_usedStandardCtor) return 0; + float fRange = _maxValue - _minValue; + try + { + for ( unsigned int i = 0; i < _iSize; i++ ) + _fData[i] = fRange - _fData[i] + 2 * _minValue; + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } + int iTemp = _minPos; + _minPos = _maxPos; + _maxPos = iTemp; + return 1; } //ADD----------------------------------------------------------------------------------------------------- -/*! Es gibt kein eigene Funktion fuer Subtraktion. Diese kann durch Addition negativer Werten durchgefuehrt +/*! Es gibt kein eigene Funktion fuer Subtraktion. Diese kann durch Addition negativer Werten durchgefuehrt werden. Schlaegt die Operation fehl, wird \c 0.0 zurueckgegeben. */ //-------------------------------------------------------------------------------------------------------- int labField::add ( float fValue ) { - if (_usedStandardCtor) return 0; - try - { - for (unsigned int i = 0; i < _iSize; i++ ) - _fData[i] += fValue; - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } - _minValue += fValue; - _maxValue += fValue; - return 1; + if (_usedStandardCtor) return 0; + try + { + for (unsigned int i = 0; i < _iSize; i++ ) + _fData[i] += fValue; + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } + _minValue += fValue; + _maxValue += fValue; + return 1; } //MULTIPLY------------------------------------------------------------------------------------------------ -/*! Es gibt kein eigene Funktion fuer Division. Diese kann durch Multiplikation inverser Werten durchgefuehrt +/*! Es gibt kein eigene Funktion fuer Division. Diese kann durch Multiplikation inverser Werten durchgefuehrt werden. Schlaegt die Operation fehl, wird \c 0.0 zurueckgegeben. */ //-------------------------------------------------------------------------------------------------------- int labField::multiply ( float fValue ) { - if (_usedStandardCtor) return 0; - try - { - for ( unsigned int i = 0; i < _iSize; i++ ) - _fData[i] *= fValue; - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } + if (_usedStandardCtor) return 0; + try + { + for ( unsigned int i = 0; i < _iSize; i++ ) + _fData[i] *= fValue; + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } - _minValue *= fValue; - _maxValue *= fValue; + _minValue *= fValue; + _maxValue *= fValue; - if ( fValue < 0 ) - { - int iTemp = _minPos; - _minPos = _maxPos; - _maxPos = iTemp; + if ( fValue < 0 ) + { + int iTemp = _minPos; + _minPos = _maxPos; + _maxPos = iTemp; - float fTemp = _minValue; - _minValue = _maxValue; - _maxValue = fTemp; - } + float fTemp = _minValue; + _minValue = _maxValue; + _maxValue = fTemp; + } - if ( fValue == 0 ) - { - _minValue = _maxValue = 0; - _minPos = _maxPos = _iSize - 1; - } + if ( fValue == 0 ) + { + _minValue = _maxValue = 0; + _minPos = _maxPos = _iSize - 1; + } - return 1; + return 1; } //ADD----------------------------------------------------------------------------------------------------- @@ -383,22 +388,22 @@ //-------------------------------------------------------------------------------------------------------- int labField::add ( const labField *oField ) { - if (_usedStandardCtor) return 0; - if (!oField) return 0; - try - { - _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); - _minPos = _maxPos = 0; - if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; - for ( unsigned int i = 0; i < _iSize; i++ ) - setValueAt(i, _fData[i] + oField->getValueAt(i) ); - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } - return 1; + if (_usedStandardCtor) return 0; + if (!oField) return 0; + try + { + _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); + _minPos = _maxPos = 0; + if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; + for ( unsigned int i = 0; i < _iSize; i++ ) + setValueAt(i, _fData[i] + oField->getValueAt(i) ); + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } + return 1; } //ADD----------------------------------------------------------------------------------------------------- @@ -406,42 +411,42 @@ //-------------------------------------------------------------------------------------------------------- int labField::multiply ( const labField *oField ) { - if (_usedStandardCtor) return 0; - try - { - _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); - _minPos = _maxPos = 0; - if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; - for ( unsigned int i = 0; i < _iSize; i++ ) - setValueAt(i, _fData[i] * oField->getValueAt(i) ); - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } - return 1; + if (_usedStandardCtor) return 0; + try + { + _minValue = _maxValue = getValueAt(0) * oField->getValueAt(0); + _minPos = _maxPos = 0; + if ( _iSize != oField->getSize() ) throw "labField::field size not equal!"; + for ( unsigned int i = 0; i < _iSize; i++ ) + setValueAt(i, _fData[i] * oField->getValueAt(i) ); + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } + return 1; } //MERGE--------------------------------------------------------------------------------------------------- -/*! Es wird der jeweils groesste Wert der beiden Felder als neuer Feldwert verwendet. Es koennen nur Felder +/*! Es wird der jeweils groesste Wert der beiden Felder als neuer Feldwert verwendet. Es koennen nur Felder gleicher Groesse gemischt werden. Schlaegt die Operation fehl, wird \c 0.0 zurueckgegeben. */ //-------------------------------------------------------------------------------------------------------- int labField::merge ( const labField &oField ) { - if (_usedStandardCtor) return 0; - try - { - if ( _iSize != oField.getSize() ) throw "labField::field size not equal!"; - for (unsigned int i = 0; i < _iSize; i++ ) - setValueAt(i, max ( _fData[i], oField.getValueAt(i) ) ); - } - catch (char *str) - { - cout << "ERROR: " << str << endl; - return 0; - } - return 1; + if (_usedStandardCtor) return 0; + try + { + if ( _iSize != oField.getSize() ) throw "labField::field size not equal!"; + for (unsigned int i = 0; i < _iSize; i++ ) + setValueAt(i, max ( _fData[i], oField.getValueAt(i) ) ); + } + catch (char *str) + { + cout << "ERROR: " << str << endl; + return 0; + } + return 1; } //GET_SIZE------------------------------------------------------------------------------------------------ @@ -449,19 +454,19 @@ //-------------------------------------------------------------------------------------------------------- int labField::getSize ( void ) const { - return _iSize; + return _iSize; } int labField::getSizeX ( void ) const { - return _iSizeX; + return _iSizeX; } int labField::getSizeY ( void ) const { - return _iSizeY; + return _iSizeY; } @@ -472,30 +477,30 @@ //-------------------------------------------------------------------------------------------------------- int labField::setSize ( int iSize ) { - if (!_usedStandardCtor) return 0; - _usedStandardCtor = false; - try - { - if ( iSize < 1 ) - throw "labField::initial field size can not be zero!"; + if (!_usedStandardCtor) return 0; + _usedStandardCtor = false; + try + { + if ( iSize < 1 ) + throw "labField::initial field size can not be zero!"; - _fData = new float[iSize]; + _fData = new float[iSize]; - if ( _fData == NULL ) - throw "labField::memory allocation failed!"; - else - { - _iSize = iSize; - fillWith( 0.0 ); - _minValue = _maxValue = 0; - _minPos = _maxPos = _iSize - 1; - } - } - catch( char * str ) - { - cout << "ERROR: " << str << endl; - } - return 1; + if ( _fData == NULL ) + throw "labField::memory allocation failed!"; + else + { + _iSize = iSize; + fillWith( 0.0 ); + _minValue = _maxValue = 0; + _minPos = _maxPos = _iSize - 1; + } + } + catch( char * str ) + { + cout << "ERROR: " << str << endl; + } + return 1; } @@ -505,123 +510,123 @@ //-------------------------------------------------------------------------------------------------------- bool labField::isValid ( void ) const { - return !_usedStandardCtor; + return !_usedStandardCtor; } void labField::_scanMinMax ( void ) { - _minValue = _maxValue = getValueAt(0); - _minPos = _maxPos = 0; - for ( unsigned int i = 0; i < _iSize; i++ ) - { - if (_fData[i] < _minValue) - { - //_minValue = getValueAt(i); - _minValue = _fData[i]; - _minPos = i; - } - if (_fData[i] > _maxValue) - { - //_maxValue = getValueAt(i); - _maxValue = _fData[i]; - _maxPos = i; - } - } + _minValue = _maxValue = getValueAt(0); + _minPos = _maxPos = 0; + for ( unsigned int i = 0; i < _iSize; i++ ) + { + if (_fData[i] < _minValue) + { + //_minValue = getValueAt(i); + _minValue = _fData[i]; + _minPos = i; + } + if (_fData[i] > _maxValue) + { + //_maxValue = getValueAt(i); + _maxValue = _fData[i]; + _maxPos = i; + } + } } int labField::binarize( float fThreshold ) { - if (_usedStandardCtor) return 0; - for ( unsigned int i = 0; i < _iSize; i++ ) - { - //if ( getValueAt(i) >= fThreshold ) setValueAt(i,1.0); else setValueAt(i,0.0); - if ( _fData[i] >= fThreshold ) setValueAt(i,1.0); else setValueAt(i,0.0); - } - return 1; + if (_usedStandardCtor) return 0; + for ( unsigned int i = 0; i < _iSize; i++ ) + { + //if ( getValueAt(i) >= fThreshold ) setValueAt(i,1.0); else setValueAt(i,0.0); + if ( _fData[i] >= fThreshold ) setValueAt(i,1.0); else setValueAt(i,0.0); + } + return 1; } int labField::cutOff( float fThreshold, float valueToSet ) { - if (_usedStandardCtor) return 0; - for ( unsigned int i = 0; i < _iSize; i++ ) - { - if ( _fData[i] <= fThreshold ) setValueAt(i,valueToSet); - } - return 1; + if (_usedStandardCtor) return 0; + for ( unsigned int i = 0; i < _iSize; i++ ) + { + if ( _fData[i] <= fThreshold ) setValueAt(i,valueToSet); + } + return 1; } int labField::fillManhattan( unsigned int iX, unsigned int iY) { - if (_usedStandardCtor) return 0; - for (unsigned int i=0; i<_iSizeX; i++) - { - for ( unsigned int j=0; j<_iSizeY; j++) - { - setValueAt(i,j, abs(int(iX-i))+abs(int(iY-j))); - } - } - return 1; + if (_usedStandardCtor) return 0; + for (unsigned int i=0; i<_iSizeX; i++) + { + for ( unsigned int j=0; j<_iSizeY; j++) + { + setValueAt(i,j, abs(int(iX-i))+abs(int(iY-j))); + } + } + return 1; } int labField::fillManhattanTextBoxCorrected( unsigned int iX, unsigned int iY, unsigned int iWidth, unsigned int iHeight) { - if (_usedStandardCtor) return 0; - int tempDist; - for (unsigned int i=0; i<_iSizeX; i++) - { - for ( unsigned int j=0; j<_iSizeY; j++) - { - tempDist = abs(int(iX-i))+abs(int(iY-j)); - if (i<iX) - { - tempDist = tempDist-min(iWidth,iX-i); - } - if (j<iY) - { - tempDist = tempDist-min(iHeight,iY-j); - } - setValueAt(i,j, tempDist); - } - } - return 1; + if (_usedStandardCtor) return 0; + int tempDist; + for (unsigned int i=0; i<_iSizeX; i++) + { + for ( unsigned int j=0; j<_iSizeY; j++) + { + tempDist = abs(int(iX-i))+abs(int(iY-j)); + if (i<iX) + { + tempDist = tempDist-min(iWidth,iX-i); + } + if (j<iY) + { + tempDist = tempDist-min(iHeight,iY-j); + } + setValueAt(i,j, tempDist); + } + } + return 1; } void labField::scanMinThreshold ( float lowBound, int &minPos, float &minValue ) { - minValue = FLT_MAX; - minPos = -1; - for ( unsigned int i = 0; i < _iSize; i++ ) - { - if (_fData[i] < minValue && _fData[i] >= lowBound) - { - minValue = _fData[i]; - minPos = i; - } - } + minValue = FLT_MAX; + minPos = -1; + for ( unsigned int i = 0; i < _iSize; i++ ) + { + if (_fData[i] < minValue && _fData[i] >= lowBound) + { + minValue = _fData[i]; + minPos = i; + } + } } void labField::scanMaxThreshold ( float upBound, int &maxPos, float &maxValue ) -{ - maxValue = FLT_MIN; - maxPos = -1; - for ( unsigned int i = 0; i < _iSize; i++ ) - { - if (_fData[i] > maxValue && _fData[i] <= upBound) - { - maxValue = _fData[i]; - maxPos = i; - } - } +{ + maxValue = FLT_MIN; + maxPos = -1; + for ( unsigned int i = 0; i < _iSize; i++ ) + { + if (_fData[i] > maxValue && _fData[i] <= upBound) + { + maxValue = _fData[i]; + maxPos = i; + } + } } float* labField::get_fData() { - return _fData; + return _fData; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-23 06:15:20
|
Revision: 99 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=99&view=rev Author: wolfspindler Date: 2009-06-23 06:14:20 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Fix of weak ISO compliance: missing typename specification added. Modified Paths: -------------- trunk/Community/METK/Sources/common/HashTable.h Modified: trunk/Community/METK/Sources/common/HashTable.h =================================================================== --- trunk/Community/METK/Sources/common/HashTable.h 2009-06-23 06:11:55 UTC (rev 98) +++ trunk/Community/METK/Sources/common/HashTable.h 2009-06-23 06:14:20 UTC (rev 99) @@ -51,7 +51,7 @@ { int i=hash(str); - std::list<R>::iterator b; + typename std::list<R>::iterator b; b = table[i].begin(); while( b != table[i].end() ) { @@ -66,7 +66,7 @@ bool remove(const std::string& str) { int i=hash(str); - std::list<R>::iterator b; + typename std::list<R>::iterator b; b = table[i].begin(); while( b != table[i].end() ) { @@ -84,7 +84,7 @@ attrType* find(const std::string& str) { int i=hash(str); - std::list<R>::iterator b; + typename std::list<R>::iterator b; b = table[i].begin(); while( b != table[i].end() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-23 06:12:48
|
Revision: 98 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=98&view=rev Author: wolfspindler Date: 2009-06-23 06:11:55 +0000 (Tue, 23 Jun 2009) Log Message: ----------- BUG: -Trial to fix platform dependency: Missing std namespace added before list class. Modified Paths: -------------- trunk/Community/METK/Sources/common/HashTable.h Modified: trunk/Community/METK/Sources/common/HashTable.h =================================================================== --- trunk/Community/METK/Sources/common/HashTable.h 2009-06-22 14:49:20 UTC (rev 97) +++ trunk/Community/METK/Sources/common/HashTable.h 2009-06-23 06:11:55 UTC (rev 98) @@ -3,9 +3,9 @@ // \file HashTable.h // \author HashTable, Copyright (c) 1998 by Michael Neumann // \author (Konrad M\xFChler) -// \date 03.06.1998, implemented by Michael Neumann +// \date 03.06.1998, implemented by Michael Neumann // \date 2005-07-05 -// +// */ //---------------------------------------------------------------------------------- @@ -23,113 +23,113 @@ class HashTable { public: - struct R - { - R() {} - R(const std::string& s, const attrType& a) : str(s), attr(a) {} - std::string str; - attrType attr; - bool operator <(const R& r) {return r.str < str;} - bool operator ==(const R& r) {return r.str == str;} - }; + struct R + { + R() {} + R(const std::string& s, const attrType& a) : str(s), attr(a) {} + std::string str; + attrType attr; + bool operator <(const R& r) {return r.str < str;} + bool operator ==(const R& r) {return r.str == str;} + }; - HashTable(int sz=2017) // sz should be a prime - { - table = new list<R>[size=sz]; - if(!table) throw MemoryException(); - } + HashTable(int sz=2017) // sz should be a prime + { + table = new std::list<R>[size=sz]; + if(!table) throw MemoryException(); + } - ~HashTable() - { - delete[] table; - } + ~HashTable() + { + delete[] table; + } - bool insert(const std::string& str, const attrType& attr) - { - - int i=hash(str); - list<R>::iterator b; - b = table[i].begin(); - while( b != table[i].end() ) - { - if( (*b).str == str ) return false; - ++b; - } - table[i].push_front(R(str,attr)); - return true; + bool insert(const std::string& str, const attrType& attr) + { + + int i=hash(str); + std::list<R>::iterator b; + b = table[i].begin(); + while( b != table[i].end() ) + { + if( (*b).str == str ) return false; + ++b; } + table[i].push_front(R(str,attr)); + return true; + } - bool remove(const std::string& str) - { - int i=hash(str); - list<R>::iterator b; - b = table[i].begin(); - while( b != table[i].end() ) - { - if( (*b).str == str ) - { - table[i].erase(b); - return true; - } - ++b; - } - return false; - } + bool remove(const std::string& str) + { + int i=hash(str); + std::list<R>::iterator b; + b = table[i].begin(); + while( b != table[i].end() ) + { + if( (*b).str == str ) + { + table[i].erase(b); + return true; + } + ++b; + } + return false; + } - attrType* find(const std::string& str) - { - int i=hash(str); - list<R>::iterator b; - b = table[i].begin(); - while( b != table[i].end() ) - { - if( (*b).str == str ) return &(*b).attr; - ++b; - } - return 0; - } + attrType* find(const std::string& str) + { + int i=hash(str); + std::list<R>::iterator b; + b = table[i].begin(); + while( b != table[i].end() ) + { + if( (*b).str == str ) return &(*b).attr; + ++b; + } + return 0; + } - list<R> *getTable() - { - return table; - } + std::list<R> *getTable() + { + return table; + } - int getSize() - { - return size; - } + int getSize() + { + return size; + } - class MemoryException {}; + class MemoryException {}; private: - int size; - list<R> *table; + int size; + std::list<R> *table; - int hash(const std::string& str) - { - unsigned h=0, g; - for(size_t i=0;i<str.length();++i) - { - h = (h << 4)+ str[i]; - if(g=h&0xf0000000) - { - h ^= g>>24; - h ^= g; - } - } - return h%size; // size is table-size - } + int hash(const std::string& str) + { + unsigned h=0, g; + for(size_t i=0;i<str.length();++i) + { + h = (h << 4)+ str[i]; + if(g=h&0xf0000000) + { + h ^= g>>24; + h ^= g; + } + } + return h%size; // size is table-size + } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-22 14:49:25
|
Revision: 97 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=97&view=rev Author: konrad79 Date: 2009-06-22 14:49:20 +0000 (Mon, 22 Jun 2009) Log Message: ----------- METK: some linux compatibility changes Modified Paths: -------------- trunk/Community/METK/Sources/common/HashTable.h Modified: trunk/Community/METK/Sources/common/HashTable.h =================================================================== --- trunk/Community/METK/Sources/common/HashTable.h 2009-06-22 14:42:04 UTC (rev 96) +++ trunk/Community/METK/Sources/common/HashTable.h 2009-06-22 14:49:20 UTC (rev 97) @@ -66,7 +66,8 @@ bool remove(const std::string& str) { int i=hash(str); - list<R>::iterator b = table[i].begin(); + list<R>::iterator b; + b = table[i].begin(); while( b != table[i].end() ) { if( (*b).str == str ) @@ -83,7 +84,8 @@ attrType* find(const std::string& str) { int i=hash(str); - list<R>::iterator b = table[i].begin(); + list<R>::iterator b; + b = table[i].begin(); while( b != table[i].end() ) { if( (*b).str == str ) return &(*b).attr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-22 14:42:08
|
Revision: 96 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=96&view=rev Author: konrad79 Date: 2009-06-22 14:42:04 +0000 (Mon, 22 Jun 2009) Log Message: ----------- METK: some linux compatibility changes Modified Paths: -------------- trunk/Community/METK/Sources/ML/METKLiftChart/METKLiftChartSystem.h trunk/Community/METK/Sources/ML/METKLiftChart/SoView2DLiftChart.cpp trunk/Community/METK/Sources/ML/METKMessaging/mlMETKMsgReceiver.cpp trunk/Community/METK/Sources/common/HashTable.h trunk/Community/METK/Sources/common/ObjMgrCommunicator.h trunk/Community/METK/Sources/common/kDebug.h Modified: trunk/Community/METK/Sources/ML/METKLiftChart/METKLiftChartSystem.h =================================================================== --- trunk/Community/METK/Sources/ML/METKLiftChart/METKLiftChartSystem.h 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/ML/METKLiftChart/METKLiftChartSystem.h 2009-06-22 14:42:04 UTC (rev 96) @@ -43,9 +43,9 @@ #include <mlOpenGL.h> -#include <windows.h> +//#include <windows.h> #include <string> -#include <FLOAT.H> +//#include <FLOAT.H> #include <GL/gl.h> #include <stdio.h> Modified: trunk/Community/METK/Sources/ML/METKLiftChart/SoView2DLiftChart.cpp =================================================================== --- trunk/Community/METK/Sources/ML/METKLiftChart/SoView2DLiftChart.cpp 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/ML/METKLiftChart/SoView2DLiftChart.cpp 2009-06-22 14:42:04 UTC (rev 96) @@ -367,4 +367,4 @@ if ((ratio <= _liftChartData->getMaxExtent() || _liftChartData->getMaxExtent() == 1.0f) && _liftChartData->getStructureVisible(iter)) return true; return false; -} \ No newline at end of file +} Modified: trunk/Community/METK/Sources/ML/METKMessaging/mlMETKMsgReceiver.cpp =================================================================== --- trunk/Community/METK/Sources/ML/METKMessaging/mlMETKMsgReceiver.cpp 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/ML/METKMessaging/mlMETKMsgReceiver.cpp 2009-06-22 14:42:04 UTC (rev 96) @@ -61,7 +61,8 @@ omObject &obj = (*oc)[OBJ_COMMUNICATION]; if (obj.isValid()) { obj[LAY_STATUSEVENTS][INF_MESSAGE] = messageFld->getStringValue(); - obj[LAY_STATUSEVENTS][INF_STATUS] = omMessage(MSG_READY); + //obj[LAY_STATUSEVENTS][INF_STATUS] = omMessage(MSG_READY); + obj[LAY_STATUSEVENTS][INF_STATUS] = MSG_READY; //for linux compatibility - not sure if it still sends an omMessage //SoDebugError::postInfo("RECEIVER: READY",""); sendNotification(); statusFld->setStringValue(MSG_DONE); @@ -98,7 +99,7 @@ if (status == MSG_INIT && message == messageFld->getStringValue()) { // instance is responsible. Setting INF_STATUS to MSG_PROCESSING statusFld->setStringValue(MSG_PROCESSING); - obj[LAY_STATUSEVENTS][INF_STATUS] = omMessage(MSG_PROCESSING); + obj[LAY_STATUSEVENTS][INF_STATUS] = omMessage(MSG_PROCESSING); //see line 64 for linux test //SoDebugError::postInfo("RECEIVER: PROCESSING",""); dataFld->setStringValue(obj[LAY_STATUSEVENTS][INF_DATA]); sendNotification(); Modified: trunk/Community/METK/Sources/common/HashTable.h =================================================================== --- trunk/Community/METK/Sources/common/HashTable.h 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/common/HashTable.h 2009-06-22 14:42:04 UTC (rev 96) @@ -51,7 +51,8 @@ { int i=hash(str); - list<R>::iterator b = table[i].begin(); + list<R>::iterator b; + b = table[i].begin(); while( b != table[i].end() ) { if( (*b).str == str ) return false; Modified: trunk/Community/METK/Sources/common/ObjMgrCommunicator.h =================================================================== --- trunk/Community/METK/Sources/common/ObjMgrCommunicator.h 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/common/ObjMgrCommunicator.h 2009-06-22 14:42:04 UTC (rev 96) @@ -73,4 +73,4 @@ ML_END_NAMESPACE -#endif // __ObjMgrCommunicator_H \ No newline at end of file +#endif // __ObjMgrCommunicator_H Modified: trunk/Community/METK/Sources/common/kDebug.h =================================================================== --- trunk/Community/METK/Sources/common/kDebug.h 2009-06-22 14:31:39 UTC (rev 95) +++ trunk/Community/METK/Sources/common/kDebug.h 2009-06-22 14:42:04 UTC (rev 96) @@ -57,4 +57,4 @@ }; -#endif // __kDebug_H \ No newline at end of file +#endif // __kDebug_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-22 14:31:42
|
Revision: 95 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=95&view=rev Author: konrad79 Date: 2009-06-22 14:31:39 +0000 (Mon, 22 Jun 2009) Log Message: ----------- METK: delete 3D-Labeling Removed Paths: ------------- trunk/Community/METK/Modules/ML/Labeling/ trunk/Community/METK/Sources/ML/Labeling/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-22 14:27:17
|
Revision: 94 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=94&view=rev Author: konrad79 Date: 2009-06-22 14:27:16 +0000 (Mon, 22 Jun 2009) Log Message: ----------- METK: remove UMDStippling Removed Paths: ------------- trunk/Community/METK/Sources/Inventor/UMDStippling/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-22 14:26:39
|
Revision: 93 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=93&view=rev Author: konrad79 Date: 2009-06-22 14:26:33 +0000 (Mon, 22 Jun 2009) Log Message: ----------- METK: add missing def files Added Paths: ----------- trunk/Community/METK/Modules/Inventor/SoQHull3D/ trunk/Community/METK/Modules/Inventor/SoQHull3D/UMDQHull3D.def trunk/Community/METK/Modules/Inventor/SoQHull3D/html/ trunk/Community/METK/Modules/Inventor/SoQHull3D/html/SoQHull3D.html trunk/Community/METK/Modules/Inventor/SoQHull3D/networks/ trunk/Community/METK/Modules/Inventor/SoQHull3D/networks/SoQHull3D.mlab trunk/Community/METK/Modules/Inventor/UMDPickInfo/ trunk/Community/METK/Modules/Inventor/UMDPickInfo/UMDPickInfo.def trunk/Community/METK/Modules/Inventor/UMDPickInfo/html/ trunk/Community/METK/Modules/Inventor/UMDPickInfo/html/SoPickInfo.html trunk/Community/METK/Modules/Inventor/UMDPickInfo/networks/ trunk/Community/METK/Modules/Inventor/UMDPickInfo/networks/SoPickInfoExample.mlab trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/ trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/UMDSoExtractColoredFaces.def trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/examples/ trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/examples/SoExtractColoredFaces.mlab trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/traceColors.txt trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleLines.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleToObjects.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoArrow.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoCake.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoDistanceLine.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMainAxis.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMinimalDistance.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoShapeToPointSet.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoThresholdToPointSet.js trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoThresholdToPointSet.script trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoAngleLines.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoAngleToObjects.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoArrow.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoCake.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoDistanceLine.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoMainAxis.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoMinimalDistance.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoRuler.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoShapeToPointSet.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoThresholdToPointSet.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/html/SoVolEstimation.html trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/measurement.def trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoAngleToObjects.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoArrow.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoMainAxis.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoMeasurement.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoMinimalDistance.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoShapeToPointSet.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoThresholdToPointSet.mlab trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/networks/SoThresholdToPointSet2.mlab trunk/Community/METK/Modules/Inventor/UMDSoView2DExtensionExample/ trunk/Community/METK/Modules/Inventor/UMDSoView2DExtensionExample/UMDSoView2DExtensionExample.def trunk/Community/METK/Modules/Inventor/UMDSoView2DExtensions/ trunk/Community/METK/Modules/Inventor/UMDSoView2DExtensions/UMDSoView2DExtensions.def trunk/Community/METK/Modules/Inventor/UMDStraightLine/ trunk/Community/METK/Modules/Inventor/UMDStraightLine/UMDStraightLine.def trunk/Community/METK/Modules/Inventor/UMDTools/ trunk/Community/METK/Modules/Inventor/UMDTools/UMDTools.def trunk/Community/METK/Modules/Inventor/UMDTools/html/ trunk/Community/METK/Modules/Inventor/UMDTools/html/SoMinimalEnclosingCircle.html trunk/Community/METK/Modules/Inventor/UMDTools/networks/ trunk/Community/METK/Modules/Inventor/UMDTools/networks/SoClearGLBuffers.mlab trunk/Community/METK/Modules/Inventor/UMDViewerTrigger/ trunk/Community/METK/Modules/Inventor/UMDViewerTrigger/UMDViewerTrigger.def trunk/Community/METK/Modules/Inventor/UMDmnOffscreenRenderer/ trunk/Community/METK/Modules/Inventor/UMDmnOffscreenRenderer/UMDmnOffscreenRenderer.def Added: trunk/Community/METK/Modules/Inventor/SoQHull3D/UMDQHull3D.def =================================================================== --- trunk/Community/METK/Modules/Inventor/SoQHull3D/UMDQHull3D.def (rev 0) +++ trunk/Community/METK/Modules/Inventor/SoQHull3D/UMDQHull3D.def 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,47 @@ +//---------------------------------------------------------------------------------- +//! UMDQHull module definitions +/*! +// \file UMDQHull.def +// \author Jens Haase +// \date 2005-02-07 +// +*/ +//---------------------------------------------------------------------------------- + + +InventorModule SoQHull3D { + DLL = UMDQHull3D + + genre = "" + author = "Jens Haase" + status = "work-in-progress" + comment = "3D Convex Hull with QHull" + keywords = "3D Convex Hull" + seeAlso = "" + projectSource = "$(UserProjectsPath)/sources/Inventor/UMDQHull3D" + hasGroupInputs = TRUE + Description { + } + + Window { + Category Options { + CheckBox showPoints { title = "Render Points" } + Field pointColor { title = "Point Color" } + CheckBox showFaces { title = "Render Faces" } + Field faceColor { title = "Face Color" } + CheckBox useColors { title = "Use Colors" } + Field state { title = "State:" edit = NO } + + } // category Volume + Category Statistics { + Field numInput { title = "# Input Values" edit = NO } + Field numOutput { title = "# Hull Vertices" edit = NO } + Field numTriangles { title = "# Hull Faces" edit = NO } + Separator { direction = horizontal } + Label { title = "values estimated by QHull:" } + Field ch_surface { title = "Surface" edit = NO } + Field ch_volume { title = "Volume" edit = NO } + } //category Statistics + } // window + +} // InventorModule SoQHull3D Added: trunk/Community/METK/Modules/Inventor/SoQHull3D/html/SoQHull3D.html =================================================================== --- trunk/Community/METK/Modules/Inventor/SoQHull3D/html/SoQHull3D.html (rev 0) +++ trunk/Community/METK/Modules/Inventor/SoQHull3D/html/SoQHull3D.html 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,237 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta name="Description" content="Template for an ILAB module"> + <title>Help - SoQHull3D</title> +<!--===============================================================--> +<!-- Draw Operator --> +<!--===============================================================--> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> +<a href="#Details">Details</a> <a href="#Inputs">Inputs</a> +<a href="#Outputs">Outputs</a> <a href="#Parameters">Parameters</a> +<a href="#EventInteract">Events&Interaction</a> <a href="#Example">Example</a> +<a href="#Tips&Tricks">Tips&Tricks</a> <a href="#KnownBugs">Known +Bugs</a> +<hr WIDTH="100%"></center> + +<h2>SoQHull3D</h2> + +<h3><a NAME="Purpose"></a>Purpose</h3> + +<blockquote>The <b>SoQHull3D</b> module calculates the convex hull of an 3d + inventor scene using the "Quickhull Algorithm".</blockquote> + +<h3><a NAME="Usage"></a>Usage</h3> + +<blockquote>Connect an invetor scene to <b>SoQHull3D</b> and the module to a 3D + viewer (e.g. SoExaminerViewer).<br>The left connector (out_qhull) gives you the convex hull, the right one (self) the input scene. +</blockquote> + +<h3><a NAME="Details"></a>Details</h3> + +<blockquote>None.</blockquote> + +<h3><a NAME="Inputs"></a>Inputs</h3> + +<blockquote>An inventor scene.</blockquote> + +<h3><a NAME="Outputs"></a>Outputs</h3> + +<blockquote> +<ul> +<li>The convex hull as points (SoPointSet) and faces (SoIndexedFaceSet).</li> +<li>The input scene (SoQhull3D behaves like SoSeparator).</li> +</ul> +</blockquote> + +<h3><a NAME="Parameters"></a>Parameters</h3> + + +<h4>Options</h4> +<blockquote>This panel contains drawing parameters and a state field.</blockquote> + +<dl> + <dl> + <ul> + <li><b>Render Points / Point Color</b></li> + </dl> + <dd> + <ul> + Select if points should be drawn.<br> + Select the point color.<br> + Default is <b>enabled / blue</b>. + </ul> + </dd> + </ul> +</dl> + + +<dl> + <dl> + <ul> + <li><b>Render Faces / Face Color</b></li> + </dl> + <dd> + <ul> + Select if faces should be drawn.<br> + Select the face color.<br> + Default is <b>enabled / yellow</b>. + </ul> + </dd> + </ul> +</dl> + + +<dl> + <dl> + <ul> + <li><b>Use Colors</b></li> + </dl> + <dd> + <ul> + Select if points and faces should be drawn in the defined colors.<br> + Deselect if points and faces should be drawn using inventor standard.<br> + Default is <b>disabled</b>. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b>State</b></li> + </dl> + <dd> + <ul> + Gives some information about calculations. + </ul> + </dd> + </ul> +</dl> + + +<h4>Statistics</h4> +<blockquote>This panel contains statistical information about the convex hull.</blockquote> + +<dl> + <dl> + <ul> + <li><b># Input Values</b></li> + </dl> + <dd> + <ul> + The number of vertex values that where collected from the inventor scene. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b># Hull Vertices</b></li> + </dl> + <dd> + <ul> + The number of vertices that build the convex hull. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b># Hull Faces</b></li> + </dl> + <dd> + <ul> + The number of faces that build the convex hull. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b>Surface</b></li> + </dl> + <dd> + <ul> + The surface of the convex hull. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b>Volume</b></li> + </dl> + <dd> + <ul> + The volume of the the convex hull. + </ul> + </dd> + </ul> +</dl> + +<blockquote>The values for surface and volume are estimated by QHull functions.</blockquote> + +<h4>"Hidden" options</h4> +<blockquote>These options are present in the automatic panel of SoQhull3D.</blockquote> + +<dl> + <dl> + <ul> + <li><b>Show Normals</b></li> + </dl> + <dd> + <ul> + Render the face or vertex normals of the convex hull.<br> + Default is <b>disabled</b>. + </ul> + </dd> + </ul> +</dl> + +<dl> + <dl> + <ul> + <li><b>Use Face Normals</b></li> + </dl> + <dd> + <ul> + Decide which kind of normals should be used for rendering: Face normals or vertex normals.<br> + Note: For some objects QHull does not generate vertex normals.<br> + Default is <b>enabled</b>. + </ul> + </dd> + </ul> +</dl> + + +<h3><a NAME="EventInteract"></a>Events & Interaction</h3> + +<blockquote>None</blockquote> + +<h3><a NAME="Example"></a>Example</h3> + +<blockquote>...</blockquote> + +<h3><a NAME="Tips&Tricks"></a>Tips & Tricks</h3> + +<blockquote>None</blockquote> + +<h3><a NAME="KnownBugs"></a>Known Bugs</h3> + +<blockquote>For some objects QHull does not generate vertex normals but the convex hull is computed. Use face normals instead.</blockquote> + +</body> +</html> \ No newline at end of file Added: trunk/Community/METK/Modules/Inventor/SoQHull3D/networks/SoQHull3D.mlab =================================================================== --- trunk/Community/METK/Modules/Inventor/SoQHull3D/networks/SoQHull3D.mlab (rev 0) +++ trunk/Community/METK/Modules/Inventor/SoQHull3D/networks/SoQHull3D.mlab 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,345 @@ +network { + watchlist = "" +} +module SoQHull3D { + internal { + frame = "-43 253 152 56" + windows { + window _default { + geometry = "29 217 218 194" + sizeHint = "218 194" + wasOpen = yes + } + window _automatic { + geometry = "743 93 231 445" + sizeHint = "231 445" + wasOpen = no + } + } //<mdl> windows + } //<mdl> internal + fields { + instanceName = SoQHull3D + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + numInput = 708 + numOutput = 60 + numTriangles = 116 + ch_surface = 278 + ch_volume = 329 + showPoints = TRUE + showFaces = TRUE + pointColor = "0.500000 0.500000 1.000000" + faceColor = "0.700000 0.700000 0.400000" + useColors = FALSE + state = "convex hull finished" + showNormals = FALSE + useFaceNormals = TRUE + } //<mdl> fields + +} //<mdl> module SoQHull3D +module SoExaminerViewer { + internal { + frame = "69 105 136 64" + windows { + window _viewer { + geometry = "456 537 400 402" + sizeHint = "400 402" + wasOpen = yes + } + window _default { + geometry = "26 59 523 369" + sizeHint = "523 369" + wasOpen = no + } + } //<mdl> windows + } //<mdl> internal + fields { + instanceName = InputScene + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0.000000 0.000000 0.000000" + transparency = DELAYED_BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_PERSPECTIVE + userSettingOrientation = "0.000000 0.000000 1.000000 0.000000" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = TRUE + height = 0.7853980064 + position = "4.689310 -15.089800 -14.256100" + orientation = "0.724829 0.656385 -0.209240 2.572080" + nearDistance = 15.11590004 + farDistance = 30.21980095 + focalDistance = 22.6602993 + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + rotationAxis = "0.000000 1.000000 0.000000" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + } //<mdl> fields + +} //<mdl> module SoExaminerViewer +module SoExaminerViewer { + internal { + frame = "-115 105 136 64" + windows { + window _default { + geometry = "26 59 523 369" + sizeHint = "523 369" + wasOpen = no + } + window _viewer { + geometry = "38 539 400 402" + sizeHint = "400 402" + wasOpen = yes + } + } //<mdl> windows + } //<mdl> internal + fields { + instanceName = ConvexHull + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0.000000 0.000000 0.000000" + transparency = DELAYED_BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_PERSPECTIVE + userSettingOrientation = "0.000000 0.000000 1.000000 0.000000" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = TRUE + height = 0.7853980064 + position = "-0.849259 -14.222800 20.616900" + orientation = "0.073594 0.325770 -0.942580 3.238300" + nearDistance = 14.9197998 + farDistance = 30.41620064 + focalDistance = 22.6602993 + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + rotationAxis = "0.000000 1.000000 0.000000" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + } //<mdl> fields + +} //<mdl> module SoExaminerViewer +module SoTranslation { + internal { + frame = "-303 469 112 56" + windows { + window _default { + geometry = "180 317 300 118" + sizeHint = "300 173" + wasOpen = no + } + } + } + fields { + instanceName = SoTranslation2 + translation = "5.000000 -5.000000 5.000000" + } +} //<mdl> module SoTranslation +module SoSeparator { + internal { + frame = "-247 373 112 56" + } + fields { + instanceName = SoSeparator2 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } + +} //<mdl> module SoSeparator +module SoSphere { + internal { + frame = "-187 469 88 56" + windows { + window _default { + geometry = "26 59 208 173" + sizeHint = "208 173" + wasOpen = no + } + } + } + fields { + instanceName = SoSphere + radius = 2 + } +} //<mdl> module SoSphere +module SoSeparator { + internal { + frame = "-31 389 112 56" + } + fields { + instanceName = SoSeparator1 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } + +} //<mdl> module SoSeparator +module SoSeparator { + internal { + frame = "181 373 104 56" + } + fields { + instanceName = SoSeparator + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } + +} //<mdl> module SoSeparator +module SoTranslation { + internal { + frame = "-87 469 112 56" + windows { + window _default { + geometry = "158 233 300 173" + sizeHint = "300 173" + wasOpen = no + } + } + } + fields { + instanceName = SoTranslation1 + translation = "5.000000 0.000000 0.000000" + } +} //<mdl> module SoTranslation +module SoTranslation { + internal { + frame = "129 469 112 56" + windows { + window _default { + geometry = "180 262 300 173" + sizeHint = "300 173" + wasOpen = no + } + } + } + fields { + instanceName = SoTranslation + translation = "0.000000 5.000000 5.000000" + } +} //<mdl> module SoTranslation +module SoCube { + internal { + frame = "341 373 88 56" + } + fields { + instanceName = SoCube2 + width = 2 + height = 2 + depth = 2 + } + +} +module SoCube { + internal { + frame = "29 469 88 56" + } + fields { + instanceName = SoCube1 + width = 2 + height = 2 + depth = 2 + } + +} +module SoCube { + internal { + frame = "249 469 80 56" + } + fields { + instanceName = SoCube + width = 2 + height = 2 + depth = 2 + } + +} +connections { + SoQHull3D.children = "SoSeparator2.self SoSeparator1.self SoSeparator.self SoCube2.self" + InputScene.children = SoQHull3D.self + ConvexHull.children = SoQHull3D.out_qhull + SoSeparator2.children = "SoTranslation2.self SoSphere.self" + SoSeparator1.children = "SoTranslation1.self SoCube1.self" + SoSeparator.children = "SoTranslation.self SoCube.self" +} + Added: trunk/Community/METK/Modules/Inventor/UMDPickInfo/UMDPickInfo.def =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDPickInfo/UMDPickInfo.def (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDPickInfo/UMDPickInfo.def 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,50 @@ +//---------------------------------------------------------------------------------- +//! UMDPickInfo module definitions +/*! +// \file UMDPickInfo.def +// \author Stefan Hiller +// \date 2007-09-11 +*/ +//---------------------------------------------------------------------------------- + + +InventorModule SoPickInfo { + DLL = "UMDPickInfo" + + genre = "" + author = "Stefan Hiller" + status = "test" + comment = "Get picking information." + keywords = "pick picking test demo" + seeAlso = "SoPickStyle" + projectSource = "$(UserProjectsPath)/sources/Inventor/UMDPickInfo" + examplenetwork = "$(LOCAL)/networks/SoPickInfoExample.mlab" + hasGroupInputs = FALSE + + Window _default { + Vertical { + expandY = True + Box Picking { + expandY = True + title = "Picking" + Field infoHitCoordinate { title = "Hit Coordinate:" expandX = YES edit = NO } + Field infoHitNormal { title = "Hit Normal:" expandX = YES edit = NO } + Separator { direction = Horizontal expandX = YES } + Table { + expandY = True + Row { + Label { title = "Pick Path:" } + Field infoTypeName { title = "Detail Type:" expandX = YES edit = NO } + } + Row { + HyperText { textField = infoPickPath expandX = YES } + HyperText { textField = infoDetail expandX = YES } + } + } + } + Field infoStatus { title = "Status:" expandX = YES edit = NO } + } + } // window _default + +} // InventorModule SoPickInfo + Added: trunk/Community/METK/Modules/Inventor/UMDPickInfo/html/SoPickInfo.html =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDPickInfo/html/SoPickInfo.html (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDPickInfo/html/SoPickInfo.html 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,76 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="Description" content="Documentation for SoPickInfo"> + <title>SoWEMFaceInspector</title> +</head> +<body> + +<center><a href="#Purpose">Purpose</a> <a href="#Usage">Usage</a> +<a href="#Details">Details</a> <a href="#Inputs">Inputs</a> +<a href="#Outputs">Outputs</a> <a href="#Parameters">Parameters</a> +<a href="#EventInteract">Events&Interaction</a> <a href="#Example">Example</a> +<a href="#Tips&Tricks">Tips&Tricks</a> <a href="#KnownBugs">Known +Bugs</a> +<hr WIDTH="100%"></center> + +<h2>SoPickInfo</h2> + +<h3><a NAME="Purpose"></a>Purpose</h3> +<blockquote> +This test module displays picking information like the picked coordinate, normal, +as well as the pick path and the pick detail. +</blockquote> + +<h3><a NAME="Usage"></a>Usage</h3> +<blockquote> +Just pick something (left-click in Pick mode). +</blockquote> + +<h3><a NAME="Details"></a>Details</h3> +<blockquote> +None. +</blockquote> + +<h3><a NAME="Inputs"></a>Inputs</h3> +<blockquote> +None. +</blockquote> + +<h3><a NAME="Outputs"></a>Outputs</h3> +<blockquote> +The only output field is of type <b>SoNode</b> and represents the module's <b>SoSeparator</b> +self node. +</blockquote> + +<h3><a NAME="Parameters"></a>Parameters</h3> +<blockquote> +see <a href="#Usage">Usage</a>. +</blockquote> + +<h3><a NAME="EventInteract"></a>Events & Interaction</h3> +<blockquote> +see <a href="#Usage">Usage</a>. +</blockquote> + +<h3><a NAME="Example"></a>Example</h3> +<blockquote> +The example network contains several primitives to pick. +</blockquote> + +<h3><a NAME="Tips&Tricks"></a>Tips & Tricks</h3> +<blockquote> +None. +</blockquote> + +<h3><a NAME="KnownBugs"></a>Known Bugs</h3> +<blockquote> +None. +</blockquote> +<br> +<br> +<br> +<br> +</body> +</html> Added: trunk/Community/METK/Modules/Inventor/UMDPickInfo/networks/SoPickInfoExample.mlab =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDPickInfo/networks/SoPickInfoExample.mlab (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDPickInfo/networks/SoPickInfoExample.mlab 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,446 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module SoTransform { + internal { + frame = "81 181 112 56" + windows { + window _default { + geometry = "359 603 441 153" + sizeHint = "441 153" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTransform4 + translation = "4 -3 2" + rotation = "0 0 1 0" + scaleFactor = "2 2 2" + scaleOrientation = "0 0 1 0" + center = "0 0 0" + } +} +module SoSeparator { + internal { + frame = "145 109 112 56" + } + fields { + instanceName = SoSeparator5 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module SoText2 { + internal { + frame = "201 181 80 56" + windows { + window _default { + geometry = "515 425 256 219" + sizeHint = "256 219" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoText2 + string = "*"Pick Me!"*" + spacing = 1 + justification = LEFT + } +} +module SoCone { + internal { + frame = "665 189 80 56" + } + fields { + instanceName = SoCone + parts = ALL + bottomRadius = 1 + height = 2 + } +} +module SoTransform { + internal { + frame = "713 261 112 56" + windows { + window _default { + geometry = "423 458 441 153" + sizeHint = "441 153" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTransform3 + translation = "3 4 0" + rotation = "0 0 1 0" + scaleFactor = "0.6 0.6 0.6" + scaleOrientation = "0 0 1 0" + center = "0 0 0" + } +} +module SoSeparator { + internal { + frame = "761 189 112 56" + } + fields { + instanceName = SoSeparator4 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module SoTransform { + internal { + frame = "545 189 112 56" + windows { + window _default { + geometry = "171 481 441 153" + sizeHint = "441 153" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTransform2 + translation = "-1 4.5 0" + rotation = "0 0 1 1" + scaleFactor = "1 1 1" + scaleOrientation = "0 0 1 0" + center = "0 0 0" + } +} +module SoSeparator { + internal { + frame = "585 117 112 56" + } + fields { + instanceName = SoSeparator3 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module SoCube { + internal { + frame = "833 261 80 56" + } + fields { + instanceName = SoCube + width = 2 + height = 2 + depth = 2 + } +} +module SoTransform { + internal { + frame = "169 333 112 56" + windows { + window _default { + geometry = "361 471 441 153" + sizeHint = "441 153" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTransform1 + translation = "3 -1 -3" + rotation = "0 0 1 0" + scaleFactor = "1 1 1" + scaleOrientation = "0 0 1 0" + center = "0 0 0" + } +} +module SoSeparator { + internal { + frame = "225 261 112 56" + } + fields { + instanceName = SoSeparator2 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module SoCylinder { + internal { + frame = "289 333 96 56" + windows { + window _default { + geometry = "543 459 119 91" + sizeHint = "119 91" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoCylinder + parts = ALL + radius = 1 + height = 2 + } +} +module SoTransform { + internal { + frame = "333 189 104 56" + windows { + window _default { + geometry = "423 458 441 153" + sizeHint = "441 153" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoTransform + translation = "1 3 -4" + rotation = "0 0 -1 0.5" + scaleFactor = "0.05 0.05 0.05" + scaleOrientation = "0 0 1 0" + center = "0 0 0" + } +} +module SoSeparator { + internal { + frame = "377 117 112 56" + } + fields { + instanceName = SoSeparator1 + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module LocalSoFile { + internal { + frame = "433 189 96 56" + windows { + window _default { + geometry = "382 429 522 211" + sizeHint = "522 211" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = LocalSoFile + name = $(DemoDataPath)/Teapot.iv + } + internalFields = "" +} +module SoLineSet { + internal { + frame = "637 333 88 56" + } + fields { + instanceName = SoLineSet + startIndex = 0 + numVertices = -1 + } +} +module SoDrawStyle { + internal { + frame = "453 429 104 56" + windows { + window _default { + geometry = "543 459 178 118" + sizeHint = "178 118" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoDrawStyle + style = FILLED + pointSize = 5 + lineWidth = 0 + linePattern = 65535 + } +} +module SoVertexProperty { + internal { + frame = "569 429 128 56" + windows { + window _default { + geometry = "512 447 263 174" + sizeHint = "263 174" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoVertexProperty + vertex = "[ 4 0 0, 0 -2 0, 4 -2 0 ]" + normal = "[ ]" + texCoord = "[ ]" + orderedRGBA = "[ ]" + materialBinding = OVERALL + normalBinding = PER_VERTEX_INDEXED + } +} +module SoSeparator { + internal { + frame = "461 253 152 56" + } + fields { + instanceName = SoSeparator + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + } +} +module SoSphere { + internal { + frame = "405 333 88 56" + } + fields { + instanceName = SoSphere + radius = 1 + } +} +module SoPointSet { + internal { + frame = "529 333 96 56" + } + fields { + instanceName = SoPointSet + startIndex = 0 + numPoints = -1 + } +} +module SoExaminerViewer { + internal { + frame = "401 -115 240 56" + windows { + window _viewer { + geometry = "709 182 400 400" + sizeHint = "400 400" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoExaminerViewer + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "0 0 0" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = FALSE + autoClipping = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_ORTHOGRAPHIC + userSettingOrientation = "0 0 1 0" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = FALSE + height = 9.080349922 + position = "8.794169999999999 5.84307 4.01408" + orientation = "-0.157358 0.826003 0.541256 1.13738" + nearDistance = 3.293679953 + farDistance = 18.07760048 + focalDistance = 11.46109962 + forceRedrawOnInteraction = FALSE + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + mouseInteraction = "" + rotationAxis = "0 1 0" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + } +} +module SoPickInfo { + internal { + frame = "153 -3 96 56" + windows { + window _default { + geometry = "678 621 524 343" + sizeHint = "524 343" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoPickInfo + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + infoHitCoordinate = "4.0906 -2.64058 1.64744" + infoObjHitCoordinate = "0.0453 0.179708 -0.176279" + infoHitNormal = "0 0 1" + infoObjHitNormal = "0 0 1" + infoStatus = "Picked something." + infoTypeName = SoTextDetail + infoPickPath = "<table border=1 cellpadding=4> <tr> <th>i</th> <th>Node</th> </tr> <tr> <td>0</td> <td></td> </tr> <tr> <td>1</td> <td></td> </tr> <tr> <td>2</td> <td>SoExaminerViewer</td> </tr> <tr> <td>3</td> <td>SoSeparator5</td> </tr> <tr> <td>4</td> <td>SoText2</td> </tr> </table>" + infoDetail = "<table border=1 cellpadding=4> <tr> <td colspan=2>SoTextDetail</td> </tr> <tr> <td>String Index</td> <td>0</td> </tr> <tr> <td>Character Index</td> <td>3</td> </tr> </table>" + } +} +connections { + SoSeparator5.children = "SoTransform4.self SoText2.self" + SoSeparator4.children = "SoTransform3.self SoCube.self" + SoSeparator3.children = "SoTransform2.self SoCone.self" + SoSeparator2.children = "SoTransform1.self SoCylinder.self" + SoSeparator1.children = "SoTransform.self LocalSoFile.outputNode" + SoLineSet.vertexProperty = SoVertexProperty.self + SoSeparator.children = "SoSphere.self SoDrawStyle.self SoPointSet.self SoLineSet.self" + SoPointSet.vertexProperty = SoVertexProperty.self + SoExaminerViewer.children = "SoPickInfo.self SoSeparator5.self SoSeparator2.self SoSeparator1.self SoSeparator.self SoSeparator3.self SoSeparator4.self" +} Added: trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/UMDSoExtractColoredFaces.def =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/UMDSoExtractColoredFaces.def (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/UMDSoExtractColoredFaces.def 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,28 @@ +//---------------------------------------------------------------------------------- +//! UMDSoExtractColoredFaces module definitions +/*! +// \file UMDSoExtractColoredFaces.def +// \author Konrad M\xFChler +// \date 2008-02-01 +*/ +//---------------------------------------------------------------------------------- + + +InventorModule SoExtractColoredFaces { + DLL = "UMDSoExtractColoredFaces" + + genre = "VesselVis" + author = "Konrad M\xFChler" + status = "stable" + comment = "" + keywords = "" + seeAlso = "" + projectSource = "$(UserProjectsPath)/sources/Inventor/UMDSoExtractColoredFaces" + hasGroupInputs = FALSE + exampleNetwork = $(LOCAL)/examples/SoExtractColoredFaces.mlab + + Description { + } + +} // InventorModule SoExtractColoredFaces + Added: trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/examples/SoExtractColoredFaces.mlab =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/examples/SoExtractColoredFaces.mlab (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/examples/SoExtractColoredFaces.mlab 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,230 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module SoExtractColoredFaces { + internal { + frame = "449 341 160 56" + windows { + window _default { + geometry = "46 509 219 287" + sizeHint = "219 287" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoExtractColoredFaces + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + selectedColor = "0.5607839999999999 1 0.435294" + valid = TRUE + } +} +module SoShapePartition { + internal { + frame = "457 261 128 56" + windows { + window _default { + geometry = "1403 777 201 159" + sizeHint = "201 159" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoShapePartition + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + shapePartitioning = TRUE + cubeSize = 10 + valid = TRUE + autoUpdate = FALSE + } +} +module LoadTreeData { + internal { + frame = "465 517 112 56" + windows { + window _default { + geometry = "1357 563 408 137" + sizeHint = "408 137" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = LoadTreeData + filename = E:/VesselTestData/data/Treedata_PV0001.txt + loadVesselVoxels = TRUE + } +} +module SoCustomExaminerViewer { + internal { + frame = "417 181 176 56" + windows { + window _viewer { + geometry = "815 268 400 400" + sizeHint = "400 400" + wasOpen = no + wasActive = no + } + window _automatic { + geometry = "401 314 484 440" + sizeHint = "484 440" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = SoCustomExaminerViewer + renderCaching = AUTO + boundingBoxCaching = AUTO + renderCulling = AUTO + pickCulling = AUTO + border = FALSE + background = "1 1 1" + transparency = BLEND + antialiasing = FALSE + antialiasingNumPasses = 1 + grabKeyFocus = TRUE + snapshotFormat = SNAPSHOT_RGB + outputAviFile = "" + autoRedrawWhenRecording = TRUE + frameRate = 7 + frameRateAvi = 15 + status = ready + outputSnapshotFile = none + outputSnapshotFileWritten = none + autoIncreaseFile = TRUE + autoUpdateML = FALSE + showSnapshotWithShell = FALSE + snapCount = 0 + headlight = TRUE + decoration = TRUE + popupMenuEnabled = FALSE + viewing = TRUE + autoClipping = TRUE + externalCamera = FALSE + drawStyle = VIEW_AS_IS + interactiveDrawStyle = VIEW_LOW_COMPLEXITY + viewAllFlag = FALSE + initialCameraOrientation = CAMERA_KEEP_AS_IS + applyCameraOrientation = CAMERA_KEEP_AS_IS + cameraType = CAMERA_PERSPECTIVE + userSettingOrientation = "0 0 1 0" + automaticViewAll = FALSE + storeCurrentState = TRUE + saveCamera = TRUE + cursor = TRUE + isCameraStored = TRUE + perspective = TRUE + height = 0.7853980064 + position = "-84.55249999999999 -249.159 -544.54" + orientation = "0.076157 -0.049001 -0.995891 1.60722" + nearDistance = 24.39649963 + farDistance = 41.73839951 + focalDistance = 33.05879974 + forceRedrawOnInteraction = FALSE + button1events = TO_VIEWER + button2events = TO_VIEWER + button3events = TO_VIEWER + keyEvents = TO_VIEWER + animationEnabled = FALSE + feedback = FALSE + feedbackSize = 32 + mouseInteraction = "" + rotationAxis = "0 1 0" + rotationAngle = 360 + rotationSteps = 80 + rotationCurrentStep = 0 + recordRotation = TRUE + enablePickNView = TRUE + enableHome = TRUE + enableViewAll = TRUE + enableSeek = TRUE + enableASC = FALSE + enableProjType = TRUE + enableDolly = TRUE + enableM3Control = FALSE + enableSpacemouseDevice = FALSE + enablePowerMateDevice = FALSE + enableAppleRemoteDevice = FALSE + chooseView = VIEW_ANTERIOR + transformDeltaIn = "1 0 0 0 +0 1 0 0 +0 0 1 0 +0 0 0 1" + } +} +module SoVascularSystem { + internal { + frame = "461 429 136 56" + windows { + window _default { + geometry = "1367 63 384 463" + sizeHint = "384 463" + wasOpen = yes + wasActive = no + } + } + } + fields { + instanceName = SoVascularSystem + whichChild = -3 + autoApply = TRUE + status = "Graph is valid" + complexity = 0.6000000238 + pointSize = 1 + lineWidth = 1 + textureScaleX = 0.5 + textureScaleY = 0.5 + textureMode = SIZE_ALMOST_EQUAL + textureCoordinateMode = FOR_ALL_ELEMENTS + recursionDepth = -1 + showLines = FALSE + labelMode = GENERAL_LABEL + textureMode = SIZE_ALMOST_EQUAL + textureCoordinateMode = FOR_ALL_ELEMENTS + radiusMode = MIN_DIST + displayMode = DISPLAY_SURFACE + radiusScale = 1 + radiusFixedSize = 1 + visible = TRUE + texture = FALSE + numSmoothingPasses = 3 + overallSmoothness = 0.6999999881 + smoothIndependently = FALSE + radiusSmoothness = 0.6999999881 + skeletonSmoothness = 0.6999999881 + endCapScaling = 1 + useGeneralColor = FALSE + generalColor = "1 1 1" + useAlternativeTransparency = TRUE + alternativeTransparencyColor = "0 0 0" + selectedCoordinate = "0 0 0" + snapMode = SNAP_TO_SKELETON + enableSelection = TRUE + nearestCoordinate = "0 0 0" + selectedEdgeId = 0 + selectedNodeId = 0 + nearestRadius = 0 + nearestLabel = 0 + nearestColor = "1 1 1" + useSkeletonColors = FALSE + } +} +connections { + SoExtractColoredFaces.input = SoVascularSystem.self + SoShapePartition.input = SoExtractColoredFaces.outShape + SoCustomExaminerViewer.children = SoShapePartition.outConvertedShape + SoVascularSystem.inputGraph = LoadTreeData.outputGraph +} Added: trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/traceColors.txt =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/traceColors.txt (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoExtractColoredFaces/traceColors.txt 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,36 @@ +Trace Colors used for vascular trees +------------------------------------ + +0.854902,0.6,0.196078 braun/oker +1,0.976471,0.368627 gelb +0.862745,0,0.172549 dunkelrot +0.560784,1,0.435294 hellgr\xFCn +0,0.819608,0.160784 dunkelgr\xFCn +1,1,1 wei\xDF +1,0.462745,0.490196 rosa \xE4hnlich +0.184314,0.247059,0.929412 dunkelblau +0.490196,0.541176,1 lila-blau + + + + + + + +//! color table according to the TreeAnalysis module (D.Selle) red green blue alpha +static const uint32_t colorsTA[15] ={0xffffffff, // 0: white -> 1.00 1.00 1.00 1.00 + 0xdc002cff, // 1: red -> 0.86 0.00 0.17 1.00 + 0xff767dff, // 2: light red -> 1.00 0.46 0.49 1.00 + 0x00d129ff, // 3: green -> 0.00 0.82 0.16 1.00 + 0x8fff6fff, // 4: light green -> 0.56 1.00 0.44 1.00 + 0x404040ff, // 5: grey -> 0.25 0.25 0.25 1.00 + 0x2f3fedff, // 6: blue -> 0.18 0.25 0.93 1.00 + 0x7d8affff, // 7: light blue -> 0.49 0.54 1.00 1.00 + 0xfff95eff, // 8: yellow -> 1.00 0.97 0.37 1.00 + 0xda9932ff, // 9: dark yellow -> 0.85 0.60 0.19 1.00 + 0x00000000, // 10: transparent -> 0.00 0.00 0.00 0.00 + 0x80fffaff, // 11: cyan -> 0.50 1.00 0.98 1.00 + 0x00aec1ff, // 12: dark cyan -> 0.00 0.68 0.76 1.00 + 0xe461ffff, // 13: magenta -> 0.89 0.27 1.00 1.00 + 0xa100adff // 14: dark magenta -> 0.63 0.06 0.68 1.00 + }; Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleLines.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleLines.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleLines.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,53 @@ + + +Description { + //Porting to MeVisLab + Field interactionMode { + items{ + item INTERACTION_DIRECT_SELECT {deprecatedName=directSelect} + } + } +} + + +Window { + Vertical Main { + Box Measures {layout=Vertical + Field startPos {} + Field endPos {} + Field connectPos {} + Horizontal {alignGroup=measureGroup + Field angleDegree{edit = NO title="Angle/Degree:"} + Field angleArc {edit = NO title ="Angle/Arc:"} + } + }//Box Measures + Box Tool {layout=Vertical + Table {alignX=left expandX=NO alignGroup=toolGroup + Row { + CheckBox unitFlag {title="Display Unit" } + Field unit {dependsOn=unitFlag title="" } + } + Row { + CheckBox toolNameFlag {title="Display Name" } + Field toolName {title="" dependsOn=toolNameFlag } + } + } + Field color {alignGroup=toolGroup} + Field minDistance {title="Line Interrupt Distance:" + tooltip="Minimal distance of distance line interrupt for drawing the result/unit" + alignGroup=toolGroup + } + }//Box Tool + Box Other { + Field = keyboardIncrement + Field = interactionMode + }//Box Other + } //Vertical Main +} // Window + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: Nsgw8zfxEoTGnjsTxBsGaGmMVTKlawJnPYHEWMKD/O71shQhsN1EaA9VYYrThWbCCvDOG7it+n5ajrCcruRqaA== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleToObjects.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleToObjects.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoAngleToObjects.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,85 @@ + + +Interface { + Parameters { + Field dummy {type=bool value=true} + } +} + + +Description { + Field transparency { + min = 0 + max = 1 + } + Field inObject1Node {deprecatedName=inputObject} + Field inObject2Node {deprecatedName=inputObject2} +} + + +Window { + Vertical { + TabView Main { + TabViewItem Display { + Box { layout=Vertical + CheckBox displayInput {title=Input alignGroup=parameter} + Horizontal { expandX=No + Empty {w=10} + Field transparency { step=.1 slider=Yes alignGroup=subParameter dependsOn=displayInput} + } + } + Box {layout=Vertical + //Tool is displayed always. + CheckBox dummy {title="Tool" dependsOn=!dummy} + Execute = "*js: ctx.field("dummy").setValue(true);*" + Horizontal {expandX=No alignX=left + Empty {w=10} + Vertical { + Table { alignGroup=subParameter + Row{ + CheckBox displayUnit {title=Unit} + Empty {} + } + Row{ + CheckBox displayName {title=Name} + Field toolName {title="" dependsOn=displayName} + } + } + CheckBox displayToolOnlyOnValid {title="Display on Valid" alignGroup=subParameter} + Field color {alignGroup=subParameter} + } + } + + } + }//TabViewItem Display + TabViewItem Measures { + Box { layout=Vertical expandY=yes + Field angleDegree {title="Angle/Deg:" edit = NO alignGroup=measureGroup} + Field connectPos {edit = NO alignGroup=measureGroup} + Field startPos {edit=no alignGroup=measureGroup} + Field endPos {edit=no alignGroup=measureGroup} + } + }//TabViewItem Measures + }//TabView Main + Horizontal { + Box {layout=Horizontal expandX=true + Empty {expandX=true} + } + Box {layout=Horizontal expandX=false + CheckBox resultsValid {enabled=false title=Valid} + } + }//Horizontal + } // Vertical +} // Window + + + + + + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: N/mv76K5fVZs91ywdaJzEhLF3+/zlE7DWBsZa/BdsRWSQcIYca5QCvepyVDo0ErQ8r8udltrAKhs3P8TvRJMPA== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoArrow.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoArrow.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoArrow.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,22 @@ + +Window { + Vertical { + Box "Geometry" {layout=Vertical + Field position {alignGroup=allAlign} + Field length {alignGroup=allAlign} + CheckBox displayHead {alignGroup=allAlign} + Field minDistance {alignGroup=allAlign} + Field scale {alignGroup=allAlign} + } + Box "Interaction" {layout=Vertical + Field rotationRef {title="Rotation Ref. Point:" alignGroup=allAlign} + } + } +} + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: CnkLIPcb1phOartvgwg7VEai84g00i9HmEJgCvfOh0/lbPwnMMuYaEP2xo4cpLUleQ+gc+6uQnNBlgLvom/0wQ== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoCake.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoCake.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoCake.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,35 @@ + +Description { + Field angleArc { + min = 0.00 + max = 6.28 + } + Field angleDegree { + min = 0.00 + max = 360.00 + } +} + +Window { + Category Parameters { + Vertical { + expandY = NO + Field angleArc { + step = 0.017 + } + Field angleDegree { + step = 1 + } + Field = radius + Field = height + } + + } // Category Parameters +} // Window + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: aW8GGckpNuBFx5GR5p2c7SzEHrpL0gvsqwiD+UV/CD4keNVvJ8KAdyTdxG/JZt8T/ElQHNhWkEeo6+eUX7vCNA== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoDistanceLine.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoDistanceLine.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoDistanceLine.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,52 @@ + + +Description { + //Porting to MeVisLab + Field interactionMode { + items{ + item INTERACTION_DIRECT_SELECT {deprecatedName=directSelect} + } + } +} + +Window { + Vertical Main{ + Box Measures {layout=Vertical + Field = startPos + Field = endPos + Field lineLength {edit=NO} + }//Box Measures + Box Tool {layout=Vertical + Table {alignX=left expandX=NO alignGroup=toolGroup + Row { + CheckBox unitFlag {title="Display Unit" } + Field unit {dependsOn=unitFlag title="" } + } + Row { + CheckBox toolNameFlag {title="Display Name" } + Field toolName {title="" dependsOn=toolNameFlag } + } + Row{ + CheckBox enableText {title=enableText} + } + } + Field color {alignGroup=toolGroup} + Field minDistance {title="Line Interrupt Distance:" + tooltip="Minimal distance of distance line interrupt for drawing the result/unit" + alignGroup=toolGroup + } + Field scaleLine { title = "Scale:" alignGroup=toolGroup } + }//Box Tool + Box Other { layout=Vertical + Field = keyboardIncrement + Field = interactionMode + } + } //Vertical Main +} // Window + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: cLKw51lP+Lh0PRRXcSlJ0c+Y7XzvvNIRz3vAga/3XuPyoxFft5+nGkm+3O4Sbh/WJpJsU9YB8Md/c12cjOjrIg== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMainAxis.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMainAxis.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMainAxis.script 2009-06-22 14:26:33 UTC (rev 93) @@ -0,0 +1,93 @@ + + +Description { + Field lineWidth { + min = 1 + max = 10 + } + + // Porting to ILAB% + Field inObject1Node {deprecatedName=inputObject} + Field axisOrigin { + items { + item ORIGIN_BARYCENTER {deprecatedName=barycenter} + item ORIGIN_MIDPOINT {deprecatedName=midpoint} + } + } +} + + +Window { + Vertical { + TabView Tools { + expandY = NO + TabViewItem Display { + panelName = "Display" + Box { layout=Vertical + CheckBox displayInput {title=Input alignGroup=parameter} + }//Box + Box {layout=Vertical + CheckBox displayMainAxis {title=Axis alignGroup=parameter} + Horizontal {expandX=No alignX=left + Empty {w=10} + Vertical{ + Field axisOrigin {title="Origin:" dependsOn=displayMainAxis alignGroup=subParameter} + Field = displayToolMeasure + Table { alignGroup=subParameter dependsOn = displayToolMeasure + Row { + CheckBox displayUnit {dependsOn=displayMainAxis title=Unit} + Field unit {dependsOn=displayUnit title=""} + } + Row { + CheckBox displayName {dependsOn=displayMainAxis title=Name} + Field toolName {dependsOn=displayName title=""} + } + } + CheckBox largestValueOnly {dependsOn=displayMainAxis title="Largest Only" alignGroup=subParameter} + CheckBox displayToolOnlyOnValid {title="Display on Valid" alignGroup=subParameter} + }//Vertical + }//Horizontal + }//Box + Box {layout=Vertical + checkBox displayBoundingBox {title="Bounding Box" alignGroup=parameter} + Horizontal {expandX=Yes alignX=left + Empty {w=10} + Field lineWidth {step=1 slider=Yes dependsOn=displayBoundingBox alignGroup=subParameter} + }//Horizontal + }//Box + Box {layout=Vertical + Field = color + } + } // TabViewItem Display + TabViewItem Measures { + panelName = "Measures" + Box "Axes Orientation" {layout=Vertical + Field xAxis {edit = NO alignGroup=vectorMeasures} + Field yAxis {edit = NO alignGroup=vectorMeasures} + Field zAxis {edit = NO alignGroup=vectorMeasures} + } + Box Extents {layout=Vertical + Field xDiameter {edit = NO expandX = YES} + Field yDiameter {edit = NO expandX = YES} + Field zDiameter {edit = NO expandX = YES} + Separator { direction = horizontal } + Field maxDiameter {edit = NO expandX = YES} + } + Box "Axes Center" {layout=Vertical + Field baryCenter {edit = NO alignGroup=vectorMeasures} + Field midPoint {edit = NO alignGroup=vectorMeasures} + } + } // TabViewItem Measures + } // TabView Tools + Box {layout=Horizontal expandX=Yes alignX=right + Field resultsValid {title="Valid" edit=No} + } + } // Vertical Main +} // Window + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAKyWeOZdMOT9Sj40ZS32A8i8GAjHkcHh3QT05EJBoHkqE3S0/FOcZM6SFkMLVcjiDmzBdoc9REZUIl5061137BkCARE=:mbUARszcrJxTM2e3H2YskVHojl15mYg4OBjlYsSeJfjTYEVwkgvJJ0eFJB4r7/u64QtiMUxLsor5/MgAGO4iCA== +//# owner: MeVis Internal Developer +//# date: 2005-08-18T18:57:42 +//# hash: eb6S/tZ1SnDrOvRA48thLmKvzw3hi2cKNAret43X25KsuFXyEsNYyMyO+NsxIW06SzjISQ/enn+cpXcwmnKJFA== +//# MeVis end Added: trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMinimalDistance.script =================================================================== --- trunk/Community/METK/Modules/Inventor/UMDSoMeasurement/SoMinimalDistance.script (rev 0) +++ trunk/Community/METK/Modules/Inventor/UMDSo... [truncated message content] |
From: <wol...@us...> - 2009-06-21 17:35:49
|
Revision: 92 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=92&view=rev Author: wolfspindler Date: 2009-06-21 17:35:47 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Lower/Upper case bugs fixed. -Invalid characters removed from some files. -Windows backslashes in paths replaced by slashes. Modified Paths: -------------- trunk/Community/METK/Sources/ML/Animation/AnimationParser/kScriptCommandObject.h trunk/Community/METK/Sources/ML/Animation/METKObjXMLWriter/mlMETKObjXMLWriter.h trunk/Community/METK/Sources/ML/Animation/UMDCampath/LinearCampath.h trunk/Community/METK/Sources/ML/Animation/UMDCampath/UMDCampath.h trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoAnnotator.cpp trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoAnnotator.h trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoLabelObject.h trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/SoLabelModul.h Property Changed: ---------------- trunk/Community/METK/Sources/common/ Modified: trunk/Community/METK/Sources/ML/Animation/AnimationParser/kScriptCommandObject.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/AnimationParser/kScriptCommandObject.h 2009-06-21 17:23:35 UTC (rev 91) +++ trunk/Community/METK/Sources/ML/Animation/AnimationParser/kScriptCommandObject.h 2009-06-21 17:35:47 UTC (rev 92) @@ -4,7 +4,7 @@ // \author Konrad M\xFChler // \date 2005-07-05 // -// +// */ //---------------------------------------------------------------------------------- @@ -20,61 +20,61 @@ #include <iostream> #include <vector> #include <algorithm> //for string-replace -#include "stdafx.h" +#include "StdAfx.h" using namespace std; -//! kScriptCommandObject is the class for handling a single command object (contains i.e. ObjectName, CommandLine and ParamStr). +//! kScriptCommandObject is the class for handling a single command object (contains i.e. ObjectName, CommandLine and ParamStr). class ANIMATION_EXPORT kScriptCommandObject { -private: - string TimeStr; - int TimeStart,TimeEnd; - string ObjectName; - string CommandStr; - string CommandLine; - string ParamStr; - //! \defgroup StringPos Position of single parts in an instruction - //@{ - //static const short STRPOS_COUNT; - static const short STRPOS_TIME; //!< TimePosition (0) - static const short STRPOS_OBJECT; //!< ObjectPosition (1) - static const short STRPOS_COMMAND; //!< CommandPosition (2) - static const short STRPOS_PARAMSTR; //!< ParameterPosition (3) - //@} +private: + string TimeStr; + int TimeStart,TimeEnd; + string ObjectName; + string CommandStr; + string CommandLine; + string ParamStr; + //! \defgroup StringPos Position of single parts in an instruction + //@{ + //static const short STRPOS_COUNT; + static const short STRPOS_TIME; //!< TimePosition (0) + static const short STRPOS_OBJECT; //!< ObjectPosition (1) + static const short STRPOS_COMMAND; //!< CommandPosition (2) + static const short STRPOS_PARAMSTR; //!< ParameterPosition (3) + //@} - //! \defgroup Delimiters - //@{ - static const char DELIMITER_COMMA; - static const char DELIMITER_SPACE; - //@} + //! \defgroup Delimiters + //@{ + static const char DELIMITER_COMMA; + static const char DELIMITER_SPACE; + //@} - //-------------------------------------------------------- - //Functions - //-------------------------------------------------------- - bool parseStr(string); - bool parseTimeStr(string); + //-------------------------------------------------------- + //Functions + //-------------------------------------------------------- + bool parseStr(string); + bool parseTimeStr(string); -public: - //-------------------------------------------------------- - //Functions - //-------------------------------------------------------- - kScriptCommandObject(); - kScriptCommandObject(string); //es wird sofort geparst - kScriptCommandObject(string, string, string, string); - bool setCommandLine(string); - string getCommandLine(); - bool setTimeStr(string); - string getTimeStr(); - int getTimeStart(); - int getTimeEnd(); - void setObjectName(string); - const string getObjectName(); - void setCommandStr(string); - string getCommandStr(); - void setParamStr(string); - string getParamStr(); +public: + //-------------------------------------------------------- + //Functions + //-------------------------------------------------------- + kScriptCommandObject(); + kScriptCommandObject(string); //es wird sofort geparst + kScriptCommandObject(string, string, string, string); + bool setCommandLine(string); + string getCommandLine(); + bool setTimeStr(string); + string getTimeStr(); + int getTimeStart(); + int getTimeEnd(); + void setObjectName(string); + const string getObjectName(); + void setCommandStr(string); + string getCommandStr(); + void setParamStr(string); + string getParamStr(); }; -#endif // _KSCRIPTCOMMANDOBJECT_ \ No newline at end of file +#endif // _KSCRIPTCOMMANDOBJECT_ Modified: trunk/Community/METK/Sources/ML/Animation/METKObjXMLWriter/mlMETKObjXMLWriter.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/METKObjXMLWriter/mlMETKObjXMLWriter.h 2009-06-21 17:23:35 UTC (rev 91) +++ trunk/Community/METK/Sources/ML/Animation/METKObjXMLWriter/mlMETKObjXMLWriter.h 2009-06-21 17:35:47 UTC (rev 92) @@ -24,7 +24,7 @@ #include "ObjMgrCommunicator.h" #include "METK.h" #include "kBasics.h" -#include "Hashtable.h" +#include "HashTable.h" #include "AnimationParser/AnimationParser.h" ML_START_NAMESPACE @@ -35,54 +35,54 @@ { public: - //! Constructor. - METKObjXMLWriter (); - ~METKObjXMLWriter (void); + //! Constructor. + METKObjXMLWriter (); + ~METKObjXMLWriter (void); - //! Handle field changes of the field \c field. - virtual void handleNotification (Field *field); + //! Handle field changes of the field \c field. + virtual void handleNotification (Field *field); - virtual void handleObjMgrNotification(); + virtual void handleObjMgrNotification(); - virtual void activateAttachments(); + virtual void activateAttachments(); private: - typedef ObjMgrClient inherited; - - // ---------------------------------------------------------- - //@{ \name Module field declarations - // ---------------------------------------------------------- + typedef ObjMgrClient inherited; - //! - NotifyField *_run; + // ---------------------------------------------------------- + //@{ \name Module field declarations + // ---------------------------------------------------------- - //! - StringField *_directory; + //! + NotifyField *_run; - //! - StringField *_filename; + //! + StringField *_directory; - //! - BoolField *_useCasePath; + //! + StringField *_filename; - //! - StringField *_objXML; + //! + BoolField *_useCasePath; + //! + StringField *_objXML; - //@} - //! Implements interface for the runtime type system of the ML. - ML_CLASS_HEADER(METKObjXMLWriter) + //@} + //! Implements interface for the runtime type system of the ML. + ML_CLASS_HEADER(METKObjXMLWriter) - void createXML(); - ObjMgrCommunicator* myObjMgr; + void createXML(); + ObjMgrCommunicator* myObjMgr; + }; ML_END_NAMESPACE -#endif // __mlMETKObjXMLWriter_H \ No newline at end of file +#endif // __mlMETKObjXMLWriter_H Modified: trunk/Community/METK/Sources/ML/Animation/UMDCampath/LinearCampath.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/UMDCampath/LinearCampath.h 2009-06-21 17:23:35 UTC (rev 91) +++ trunk/Community/METK/Sources/ML/Animation/UMDCampath/LinearCampath.h 2009-06-21 17:35:47 UTC (rev 92) @@ -1,4 +1,4 @@ -#ifndef _LINEARCAMPATH_ +#ifndef _LINEARCAMPATH_ #define _LINEARCAMPATH_ #include "UMDCampath.h" @@ -6,11 +6,11 @@ ML_START_NAMESPACE class LinearCampath:public AbstractCampath{ - public: - LinearCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, - vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); - ~LinearCampath(); - void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&); + public: + LinearCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, + vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); + ~LinearCampath(); + void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&); }; ML_END_NAMESPACE #endif Modified: trunk/Community/METK/Sources/ML/Animation/UMDCampath/UMDCampath.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/UMDCampath/UMDCampath.h 2009-06-21 17:23:35 UTC (rev 91) +++ trunk/Community/METK/Sources/ML/Animation/UMDCampath/UMDCampath.h 2009-06-21 17:35:47 UTC (rev 92) @@ -1,4 +1,4 @@ -#ifndef _UMDCAMPATH_ +#ifndef _UMDCAMPATH_ #define _UMDCAMPATH_ #include <vector> @@ -14,45 +14,45 @@ ML_START_NAMESPACE struct ScenePosition { - vec3 position; - double height; - vec4 orientation; - bool polarCoord; - std::vector<std::string> objects; - ScenePosition(vec3 p, double h, vec4 o,bool pc,std::vector<std::string> objs):position(p),height(h),orientation(o),polarCoord(pc),objects(objs){} - ScenePosition(){} + vec3 position; + double height; + vec4 orientation; + bool polarCoord; + std::vector<std::string> objects; + ScenePosition(vec3 p, double h, vec4 o,bool pc,std::vector<std::string> objs):position(p),height(h),orientation(o),polarCoord(pc),objects(objs){} + ScenePosition(){} }; class AbstractCampath { - public: - AbstractCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, - vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); - virtual ~AbstractCampath()=0; - void preCalcCamPathPositions(kScriptFrameEntry* frameEntry, int globalFrameNr, int /*commandID*/); - virtual void calcPositions(SbVec3f* bbc,kScriptFrameEntry*,int,double,double,SbVec3f*,SbVec3f*,SbVec3f*,SbVec3f*,int frameFrom,int frameTo); - virtual void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&)=0; - bool testParameters(kScriptFrameEntry*); - void setParameters(int,int,kScriptFrameEntry*,double,SbVec3f*,SbVec3f*); - void writeCalculatedCamPathValues(std::vector<std::string>* tempEntryParams, kScriptFrameEntry* currentEntry, int frameNr, size_t FrameEntryListIter, int commandID); - void writeOrientation(SbRotation orientation); - void writePosition(SbVec3f position); - void readParameter(kScriptFrameEntry*); - void calcFramesPerScene(int); - ObjMgrCommunicator* myObjMgr; - StringField* fldAnimationViewerName; - kScriptFrameList* myList; - kCamera* mainCamera; - AnimationCache* myCache; - vector<SbVec3f>* testPositions; - Vec3fField* fldTestSphereCenter; - DoubleField* fldTestSphereRadius; - Vec3fField* fldTestTargetPosition; - BoolField* fldDrawCameraPath; - int framesPerScene; - ScenePosition scenePosition; - std::string objectName,pathName; - double maxHeight; + public: + AbstractCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, + vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); + virtual ~AbstractCampath()=0; + void preCalcCamPathPositions(kScriptFrameEntry* frameEntry, int globalFrameNr, int /*commandID*/); + virtual void calcPositions(SbVec3f* bbc,kScriptFrameEntry*,int,double,double,SbVec3f*,SbVec3f*,SbVec3f*,SbVec3f*,int frameFrom,int frameTo); + virtual void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&)=0; + bool testParameters(kScriptFrameEntry*); + void setParameters(int,int,kScriptFrameEntry*,double,SbVec3f*,SbVec3f*); + void writeCalculatedCamPathValues(std::vector<std::string>* tempEntryParams, kScriptFrameEntry* currentEntry, int frameNr, size_t FrameEntryListIter, int commandID); + void writeOrientation(SbRotation orientation); + void writePosition(SbVec3f position); + void readParameter(kScriptFrameEntry*); + void calcFramesPerScene(int); + ObjMgrCommunicator* myObjMgr; + StringField* fldAnimationViewerName; + kScriptFrameList* myList; + kCamera* mainCamera; + AnimationCache* myCache; + vector<SbVec3f>* testPositions; + Vec3fField* fldTestSphereCenter; + DoubleField* fldTestSphereRadius; + Vec3fField* fldTestTargetPosition; + BoolField* fldDrawCameraPath; + int framesPerScene; + ScenePosition scenePosition; + std::string objectName,pathName; + double maxHeight; }; ML_END_NAMESPACE #endif Modified: trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoAnnotator.cpp =================================================================== --- trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoAnnotator.cpp 2009-06-21 17:23:35 UTC (rev 91) +++ trunk/Community/METK/Sources/ML/Labeling/UMDLabelModul/Data/SoAnnotator.cpp 2009-06-21 17:35:47 UTC (rev 92) @@ -1,5 +1,7 @@ -#define WIN32_LEAN_AND_MEAN // Selten verwendete Teile der Windows-Header nicht einbinden -#include <windows.h> +#define WIN32_LEAN_AND_MEAN // Selten verwendete Teile der Windows-Header nicht einbinden +#ifdef WIN32 + #include <windows.h> +#endif #include "SoAnnotator.h" #include "SoLabelObject.h" @@ -8,43 +10,43 @@ void SoAnnotator::initClass() { - SO_NODE_INIT_CLASS(SoAnnotator, SoGroup, "Group"); //Original + SO_NODE_INIT_CLASS(SoAnnotator, SoGroup, "Group"); //Original } SoAnnotator::SoAnnotator() -{ - SO_NODE_CONSTRUCTOR(SoAnnotator); - SO_NODE_ADD_FIELD(_redraw,(TRUE)); +{ + SO_NODE_CONSTRUCTOR(SoAnnotator); + SO_NODE_ADD_FIELD(_redraw,(TRUE)); - //isInit=false; + //isInit=false; - _bufferDT = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); // auch n\xF6tig, da rand bei ermittleMaxima sonst schwierigkeiten macht - _bufferDT1 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); - _bufferDT2 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); - _bufferDT3 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); - _bufferDT4 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); + _bufferDT = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); // auch n\xF6tig, da rand bei ermittleMaxima sonst schwierigkeiten macht + _bufferDT1 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); + _bufferDT2 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); + _bufferDT3 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); + _bufferDT4 = (unsigned char *) malloc(BUFFER_X_SIZE * BUFFER_Y_SIZE); - _weightExternalLength = 0.9; - _weightExternalAngle = 1.0; - _weightExternalDelta = 0.8; - _weightExternalNeighbor = 0.7; - _weight_LengthInvisObj = 1.0; - _weight_AngleInvisObj = 0.0; - _weight_DeltaInvisObj = 0.8; - _weight_NeighborInvisObj=0.0; + _weightExternalLength = 0.9; + _weightExternalAngle = 1.0; + _weightExternalDelta = 0.8; + _weightExternalNeighbor = 0.7; + _weight_LengthInvisObj = 1.0; + _weight_AngleInvisObj = 0.0; + _weight_DeltaInvisObj = 0.8; + _weight_NeighborInvisObj=0.0; - _skipLevel=1;//original 4; - _orbitDistance=20;//original 20 - _agentExternalLifetime = 5; //original 5 + _skipLevel=1;//original 4; + _orbitDistance=20;//original 20 + _agentExternalLifetime = 5; //original 5 - _useAgents = true; - _useOrthoStyle=false; - _debug = false; - _drawOrbit=false; - _autoUpdate = false; + _useAgents = true; + _useOrthoStyle=false; + _debug = false; + _drawOrbit=false; + _autoUpdate = false; - _obscureFactor = 4; + _obscureFactor = 4; } @@ -52,8 +54,8 @@ void SoAnnotator::init( std::vector<SoLabelObject*> &_myLabelObjects ) -{ - myLabelObjects = &_myLabelObjects; +{ + myLabelObjects = &_myLabelObjects; } @@ -67,148 +69,148 @@ void SoAnnotator::GLRender(SoGLRenderAction *action) { - int i; - SbMatrix projectionMatrix; - SbMatrix viewingMatrix; - const SbViewportRegion vp = action->getViewportRegion(); + int i; + SbMatrix projectionMatrix; + SbMatrix viewingMatrix; + const SbViewportRegion vp = action->getViewportRegion(); - _state = action->getState(); - _origin = vp.getViewportOriginPixels(); - _size = vp.getViewportSizePixels(); + _state = action->getState(); + _origin = vp.getViewportOriginPixels(); + _size = vp.getViewportSizePixels(); - const SbViewVolume &vv = SoViewVolumeElement::get(_state); + const SbViewVolume &vv = SoViewVolumeElement::get(_state); - glPushMatrix(); - projectionMatrix.makeIdentity(); - viewingMatrix.makeIdentity(); + glPushMatrix(); + projectionMatrix.makeIdentity(); + viewingMatrix.makeIdentity(); - SoViewingMatrixElement::set(_state,this,viewingMatrix); - SoProjectionMatrixElement::set(_state,this,projectionMatrix); + SoViewingMatrixElement::set(_state,this,viewingMatrix); + SoProjectionMatrixElement::set(_state,this,projectionMatrix); - SbVec3f dir; + SbVec3f dir; - if (_autoUpdate || _layoutUpdate) // Komplettes Relayout - { - erzeugeDistanzFeld(_bufferID); - ermittleMaxima(); + if (_autoUpdate || _layoutUpdate) // Komplettes Relayout + { + erzeugeDistanzFeld(_bufferID); + ermittleMaxima(); - findCandidatesExtLabel(); // orbit + findCandidatesExtLabel(); // orbit - for (int i=0; i<(int)myLabelObjects->size(); i++) - { - if ((*myLabelObjects)[i]->on) - { - //weltkoordinaten ermitteln - //Centerbox auf ScreenKoordinaten umrechnen - vv.projectToScreen( (*myLabelObjects)[i]->centerBB, dir); - //mit VP-Gr\xF6\xDFe Multiplizieren - dir.setValue( dir.getValue()[0]*_size[0], dir.getValue()[1]*_size[1], dir.getValue()[2] ); - (*myLabelObjects)[i]->screenCenterBB.setValue( dir.getValue() ); + for (int i=0; i<(int)myLabelObjects->size(); i++) + { + if ((*myLabelObjects)[i]->on) + { + //weltkoordinaten ermitteln + //Centerbox auf ScreenKoordinaten umrechnen + vv.projectToScreen( (*myLabelObjects)[i]->centerBB, dir); + //mit VP-Gr\xF6\xDFe Multiplizieren + dir.setValue( dir.getValue()[0]*_size[0], dir.getValue()[1]*_size[1], dir.getValue()[2] ); + (*myLabelObjects)[i]->screenCenterBB.setValue( dir.getValue() ); - if (_maximumWert[i+1][0] == 0) - { - (*myLabelObjects)[i]->labelState.visible = false; //wird sp\xE4ter erst ber\xFCcksichtigt, ob versteckt gelabelt werden soll - (*myLabelObjects)[i]->referenceLine.comment5="--invisible weil _maximumWert[i+1][0]=0--"; - (*myLabelObjects)[i]->labelState.isObjectVisible = false; - } - else - { - (*myLabelObjects)[i]->labelState.visible = true; //potentiell setzbar sichtbar - (*myLabelObjects)[i]->labelState.isObjectVisible = true; - } - (*myLabelObjects)[i]->labelState.onConvexHull = false; + if (_maximumWert[i+1][0] == 0) + { + (*myLabelObjects)[i]->labelState.visible = false; //wird sp\xE4ter erst ber\xFCcksichtigt, ob versteckt gelabelt werden soll + (*myLabelObjects)[i]->referenceLine.comment5="--invisible weil _maximumWert[i+1][0]=0--"; + (*myLabelObjects)[i]->labelState.isObjectVisible = false; + } + else + { + (*myLabelObjects)[i]->labelState.visible = true; //potentiell setzbar sichtbar + (*myLabelObjects)[i]->labelState.isObjectVisible = true; + } + (*myLabelObjects)[i]->labelState.onConvexHull = false; - if ( (*myLabelObjects)[i]->on ) //wenn label gar nicht gezeichnet werden soll, dann als behandelt markieren - { - (*myLabelObjects)[i]->labelState.alreadyProcessed = false; - } - else - { - (*myLabelObjects)[i]->labelState.alreadyProcessed = true; - } + if ( (*myLabelObjects)[i]->on ) //wenn label gar nicht gezeichnet werden soll, dann als behandelt markieren + { + (*myLabelObjects)[i]->labelState.alreadyProcessed = false; + } + else + { + (*myLabelObjects)[i]->labelState.alreadyProcessed = true; + } - (*myLabelObjects)[i]->setViewportDimensions( _size[0], _size[1] ); - } - } - evalExtLabels(); + (*myLabelObjects)[i]->setViewportDimensions( _size[0], _size[1] ); + } + } + evalExtLabels(); - _agentExternalLifetimeLeft = _agentExternalLifetime; + _agentExternalLifetimeLeft = _agentExternalLifetime; - _layoutUpdate = false; - } - else - { - //else zweig wird zur zeit nicht benutzt, da auch noch fehlerhaft - //Individuelles Relayout durch Agenten (ist auch intern ist in evalIntLabels-> mehr Tr\xE4gheit) - if (_useAgents) - { - if (_agentExternalLifetimeLeft) - { - for (i=0; i<(int)myLabelObjects->size(); i++) - { - if ((*myLabelObjects)[i]->labelState.visible && (*myLabelObjects)[i]->on ) // nur behandeln, wenn Objekt momentan sichtbar - { - // erstmal um Ankerpunkt k\xFCmmern - agentExternalAnchorCheckNeighborhoodDF(i); - // jetzt um die Texte k\xFCmmern, damit die sich von ihren direkten Nachbarn auf dem Orbit absto\xDFen - agentExternalTextCheckNeighborhood(i); - resolveLineLineIntersections(); // - } - } - _agentExternalLifetimeLeft--; - } - } - } + _layoutUpdate = false; + } + else + { + //else zweig wird zur zeit nicht benutzt, da auch noch fehlerhaft + //Individuelles Relayout durch Agenten (ist auch intern ist in evalIntLabels-> mehr Tr\xE4gheit) + if (_useAgents) + { + if (_agentExternalLifetimeLeft) + { + for (i=0; i<(int)myLabelObjects->size(); i++) + { + if ((*myLabelObjects)[i]->labelState.visible && (*myLabelObjects)[i]->on ) // nur behandeln, wenn Objekt momentan sichtbar + { + // erstmal um Ankerpunkt k\xFCmmern + agentExternalAnchorCheckNeighborhoodDF(i); + // jetzt um die Texte k\xFCmmern, damit die sich von ihren direkten Nachbarn auf dem Orbit absto\xDFen + agentExternalTextCheckNeighborhood(i); + resolveLineLineIntersections(); // + } + } + _agentExternalLifetimeLeft--; + } + } + } - if (_drawOrbit) drawOrbitPoints(); - glPopMatrix(); + if (_drawOrbit) drawOrbitPoints(); + glPopMatrix(); - //KONRAD - //glClear(GL_COLOR_BUFFER_BIT); - //glClear(GL_DEPTH_BUFFER_BIT); - //glClear(GL_STENCIL_BUFFER_BIT); - //glClear(GL_ACCUM_BUFFER_BIT); - + //KONRAD + //glClear(GL_COLOR_BUFFER_BIT); + //glClear(GL_DEPTH_BUFFER_BIT); + //glClear(GL_STENCIL_BUFFER_BIT); + //glClear(GL_ACCUM_BUFFER_BIT); - SoAnnotator::doAction(action); -// SoGroup::GLRender(action); + SoAnnotator::doAction(action); + +// SoGroup::GLRender(action); } void SoAnnotator::callback(SoCallbackAction *action) { - SoAnnotator::doAction(action); - - -// SoGroup::callback(action); + SoAnnotator::doAction(action); + + +// SoGroup::callback(action); } void SoAnnotator::doAction(SoAction* /*action*/) -{ +{ // nothing left to do here... - - -// SoGroup::doAction(action); + + +// SoGroup::doAction(action); } void SoAnnotator::drawOrbitPoints() { - glColor3f(1.0, 0.0, 0.0); - glPointSize(1.0); - float ox, oy; - glBegin(GL_POINTS); - for (int i=0; i<(int)_orbit.size(); i++) - { - ox=_orbit[i].x; - oy=_orbit[i].y; - ox=((ox/_size[0])*2.0)-1.0; - oy=((oy/_size[1])*2.0)-1.0; - glVertex3f( ox, oy, 1.0 ); - } - glEnd(); + glColor3f(1.0, 0.0, 0.0); + glPointSize(1.0); + float ox, oy; + glBegin(GL_POINTS); + for (int i=0; i<(int)_orbit.size(); i++) + { + ox=_orbit[i].x; + oy=_orbit[i].y; + ox=((ox/_size[0])*2.0)-1.0; + oy=((oy/_size[1])*2.0)-1.0; + glVertex3f( ox, oy, 1.0 ); + } + glEnd(); } @@ -217,402 +219,402 @@ void SoAnnotator::erzeugeDistanzFeld(unsigned char *bilddaten) { - int x,y, treffer; - unsigned char min, pixelWert, farbindex, wert[4], wertTop=0, wertTopIndex = 0; + int x,y, treffer; + unsigned char min, pixelWert, farbindex, wert[4], wertTop=0, wertTopIndex = 0; - memset(_bufferDT, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); - memset(_bufferDT1, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); - memset(_bufferDT2, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); - memset(_bufferDT3, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); - memset(_bufferDT4, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); + memset(_bufferDT, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); + memset(_bufferDT1, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); + memset(_bufferDT2, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); + memset(_bufferDT3, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); + memset(_bufferDT4, 0, BUFFER_X_SIZE*BUFFER_Y_SIZE / _skipLevel); - //TESTEN OB size>BUFFER_X_SIZE - /*memset(_bufferDT, 0, _size[0]*_size[1] / _skipLevel); - memset(_bufferDT1, 0, _size[0]*_size[1] / _skipLevel); - memset(_bufferDT2, 0, _size[0]*_size[1] / _skipLevel); - memset(_bufferDT3, 0, _size[0]*_size[1] / _skipLevel); - memset(_bufferDT4, 0, _size[0]*_size[1] / _skipLevel);*/ + //TESTEN OB size>BUFFER_X_SIZE + /*memset(_bufferDT, 0, _size[0]*_size[1] / _skipLevel); + memset(_bufferDT1, 0, _size[0]*_size[1] / _skipLevel); + memset(_bufferDT2, 0, _size[0]*_size[1] / _skipLevel); + memset(_bufferDT3, 0, _size[0]*_size[1] / _skipLevel); + memset(_bufferDT4, 0, _size[0]*_size[1] / _skipLevel);*/ - // von unten links nach oben rechts - for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt - { - for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt - { - treffer = 0; // neue Suche - farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + // von unten links nach oben rechts + for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt + { + for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt + { + treffer = 0; // neue Suche + farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (treffer == 0) // wenn alle Nachbarn gleich - { - min = 255; - pixelWert = _bufferDT1[(y-1)*_size[0] + (x-1)]; // bottom-left - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT1[(y-1)*_size[0] + x]; // bottom - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT1[y*_size[0] + (x-1)]; // left - if (pixelWert < min) min = pixelWert; + if (treffer == 0) // wenn alle Nachbarn gleich + { + min = 255; + pixelWert = _bufferDT1[(y-1)*_size[0] + (x-1)]; // bottom-left + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT1[(y-1)*_size[0] + x]; // bottom + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT1[y*_size[0] + (x-1)]; // left + if (pixelWert < min) min = pixelWert; - if (min<255) _bufferDT1[y*_size[0] + x] = min+1; - else _bufferDT1[y*_size[0] + x] = 255; - } - } - } + if (min<255) _bufferDT1[y*_size[0] + x] = min+1; + else _bufferDT1[y*_size[0] + x] = 255; + } + } + } - // von oben rechts nach unten links - for (x=(_size[0]/_skipLevel)-_skipLevel; x>=_skipLevel; x--) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt - for (y=(_size[1]/_skipLevel)-_skipLevel; y>=_skipLevel; y--) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt - treffer = 0; // neue Suche - farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + // von oben rechts nach unten links + for (x=(_size[0]/_skipLevel)-_skipLevel; x>=_skipLevel; x--) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt + for (y=(_size[1]/_skipLevel)-_skipLevel; y>=_skipLevel; y--) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt + treffer = 0; // neue Suche + farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (treffer == 0) { // wenn alle Nachbarn gleich - min = 255; - pixelWert = _bufferDT2[(y+1)*_size[0] + (x+1)]; // top-right - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT2[(y+1)*_size[0] + x]; // top - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT2[y*_size[0] + (x+1)]; // right - if (pixelWert < min) min = pixelWert; + if (treffer == 0) { // wenn alle Nachbarn gleich + min = 255; + pixelWert = _bufferDT2[(y+1)*_size[0] + (x+1)]; // top-right + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT2[(y+1)*_size[0] + x]; // top + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT2[y*_size[0] + (x+1)]; // right + if (pixelWert < min) min = pixelWert; - if (min<255) _bufferDT2[y*_size[0] + x] = min+1; - else _bufferDT2[y*_size[0] + x] = 255; - } - } - } + if (min<255) _bufferDT2[y*_size[0] + x] = min+1; + else _bufferDT2[y*_size[0] + x] = 255; + } + } + } - // von unten rechts nach oben links - for (x=(_size[0]/_skipLevel)-_skipLevel; x>=_skipLevel; x--) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt - for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt - treffer = 0; // neue Suche - farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + // von unten rechts nach oben links + for (x=(_size[0]/_skipLevel)-_skipLevel; x>=_skipLevel; x--) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt + for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt + treffer = 0; // neue Suche + farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (treffer == 0) { // wenn alle Nachbarn gleich - min = 255; - pixelWert = _bufferDT3[(y-1)*_size[0] + (x+1)]; // bottom-right - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT3[(y-1)*_size[0] + x]; // bottom - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT3[y*_size[0] + (x+1)]; // right - if (pixelWert < min) min = pixelWert; + if (treffer == 0) { // wenn alle Nachbarn gleich + min = 255; + pixelWert = _bufferDT3[(y-1)*_size[0] + (x+1)]; // bottom-right + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT3[(y-1)*_size[0] + x]; // bottom + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT3[y*_size[0] + (x+1)]; // right + if (pixelWert < min) min = pixelWert; - if (min<255) _bufferDT3[y*_size[0] + x] = min+1; - else _bufferDT3[y*_size[0] + x] = 255; - } - } - } + if (min<255) _bufferDT3[y*_size[0] + x] = min+1; + else _bufferDT3[y*_size[0] + x] = 255; + } + } + } - // von oben rechts nach unten links - for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt - for (y=(_size[1]/_skipLevel)-_skipLevel; y>=_skipLevel; y--) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt - treffer = 0; // neue Suche - farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + // von oben rechts nach unten links + for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt + for (y=(_size[1]/_skipLevel)-_skipLevel; y>=_skipLevel; y--) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt + treffer = 0; // neue Suche + farbindex = bilddaten[y*_skipLevel*_size[0]*_obscureFactor + x*_skipLevel*_obscureFactor]; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x-1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y+1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; + if (bilddaten[(y-1)*_skipLevel*_size[0]*_obscureFactor + (x+1)*_skipLevel*_obscureFactor] != farbindex) treffer++; - if (treffer == 0) { // wenn alle Nachbarn gleich - min = 255; - pixelWert = _bufferDT4[(y+1)*_size[0] + (x-1)]; // top-left - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT4[(y+1)*_size[0] + x]; // top - if (pixelWert < min) min = pixelWert; - pixelWert = _bufferDT4[y*_size[0] + (x-1)]; // left - if (pixelWert < min) min = pixelWert; + if (treffer == 0) { // wenn alle Nachbarn gleich + min = 255; + pixelWert = _bufferDT4[(y+1)*_size[0] + (x-1)]; // top-left + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT4[(y+1)*_size[0] + x]; // top + if (pixelWert < min) min = pixelWert; + pixelWert = _bufferDT4[y*_size[0] + (x-1)]; // left + if (pixelWert < min) min = pixelWert; - if (min<255) _bufferDT4[y*_size[0] + x] = min+1; - else _bufferDT4[y*_size[0] + x] = 255; - } - } - } + if (min<255) _bufferDT4[y*_size[0] + x] = min+1; + else _bufferDT4[y*_size[0] + x] = 255; + } + } + } - // nun die MIN(a,b,c,d) ermitteln und in bildaten speichern - for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt - for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) { - wert[0] = _bufferDT1[y*_size[0] + x]; - wert[1] = _bufferDT2[y*_size[0] + x]; - wert[2] = _bufferDT3[y*_size[0] + x]; - wert[3] = _bufferDT4[y*_size[0] + x]; + // nun die MIN(a,b,c,d) ermitteln und in bildaten speichern + for (x=_skipLevel; x<_size[0]/_skipLevel-1; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt + for (y=_skipLevel; y<_size[1]/_skipLevel-1; y++) { + wert[0] = _bufferDT1[y*_size[0] + x]; + wert[1] = _bufferDT2[y*_size[0] + x]; + wert[2] = _bufferDT3[y*_size[0] + x]; + wert[3] = _bufferDT4[y*_size[0] + x]; - wertTop = 255; - for (int i=0; i<4; i++) { // minimum - if (wert[i] <= wertTop) { - wertTop = wert[i]; - wertTopIndex = i; - } - } - _bufferDT[y*_size[0] + x] = wert[wertTopIndex]; - } - } + wertTop = 255; + for (int i=0; i<4; i++) { // minimum + if (wert[i] <= wertTop) { + wertTop = wert[i]; + wertTopIndex = i; + } + } + _bufferDT[y*_size[0] + x] = wert[wertTopIndex]; + } + } } void SoAnnotator::ermittleMaxima() { - // Ma\xDF: sammle pro Farbe die n gr\xF6\xDFten Werte - // FixMe: aus Performancegr\xFCnden wird nur der R-wert getrachtet - int x, y, currentIndex; - unsigned char farbindex, distanzWert; //MB: ggf. farbwert 0 rausnehmen + // Ma\xDF: sammle pro Farbe die n gr\xF6\xDFten Werte + // FixMe: aus Performancegr\xFCnden wird nur der R-wert getrachtet + int x, y, currentIndex; + unsigned char farbindex, distanzWert; //MB: ggf. farbwert 0 rausnehmen - memcpy(_maximumWertAlt, _maximumWert, sizeof(_maximumWertAlt)); - memset(_maximumWert, 0, sizeof(_maximumWert)); // init - memset(_maximum, 0, sizeof(_maximum)); - memset(_maximumIndex, 0, sizeof(_maximumIndex)); - memset(_maximumIndexAlt, 0, sizeof(_maximumIndexAlt)); + memcpy(_maximumWertAlt, _maximumWert, sizeof(_maximumWertAlt)); + memset(_maximumWert, 0, sizeof(_maximumWert)); // init + memset(_maximum, 0, sizeof(_maximum)); + memset(_maximumIndex, 0, sizeof(_maximumIndex)); + memset(_maximumIndexAlt, 0, sizeof(_maximumIndexAlt)); - for (x=1; x<_size[0]/_skipLevel; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt //MB: TEST _skipLevel -1 - for (y=1; y<_size[1]/_skipLevel; y++) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt //MB: TEST _skipLevel -1 - farbindex = _bufferID[(y*_skipLevel)*_size[0]*_obscureFactor+(x*_skipLevel)*_obscureFactor]; // Farbindex der position - distanzWert = _bufferDT[y*_size[0]+x]; - currentIndex = _maximumIndex[farbindex]; + for (x=1; x<_size[0]/_skipLevel; x++) { // jedes Pixel X, Achtung Rand nicht ber\xFCcksichtigt //MB: TEST _skipLevel -1 + for (y=1; y<_size[1]/_skipLevel; y++) { // jedes Pixel Y, Achtung Rand nicht ber\xFCcksichtigt //MB: TEST _skipLevel -1 + farbindex = _bufferID[(y*_skipLevel)*_size[0]*_obscureFactor+(x*_skipLevel)*_obscureFactor]; // Farbindex der position + distanzWert = _bufferDT[y*_size[0]+x]; + currentIndex = _maximumIndex[farbindex]; - if (distanzWert >= _maximumWert[farbindex][_maximumIndexAlt[farbindex]]) { - _maximum[farbindex][currentIndex].x = x * _skipLevel; - _maximum[farbindex][currentIndex].y = y * _skipLevel; - _maximumWert[farbindex][currentIndex] = distanzWert; - _maximumIndexAlt[farbindex] = currentIndex; - _maximumIndex[farbindex] = (currentIndex+1) % NUMBER_OF_MAXIMA; - } - } - } + if (distanzWert >= _maximumWert[farbindex][_maximumIndexAlt[farbindex]]) { + _maximum[farbindex][currentIndex].x = x * _skipLevel; + _maximum[farbindex][currentIndex].y = y * _skipLevel; + _maximumWert[farbindex][currentIndex] = distanzWert; + _maximumIndexAlt[farbindex] = currentIndex; + _maximumIndex[farbindex] = (currentIndex+1) % NUMBER_OF_MAXIMA; + } + } + } } void SoAnnotator::findeOrbit(int distance) { - int x,y; + int x,y; - _orbitcounter = 0; - _orbit.clear(); - //orbit.resize( (_size[0]/_skipLevel * _size[1]/_skipLevel) ); - for (x=0; x<_size[0]/_skipLevel; x++) { - for (y=0; y<_size[1]/_skipLevel; y++) { - if (_bufferDT[y*_size[0] + x] == distance) { - if (_bufferID[(y*_skipLevel)*_size[0]*_obscureFactor + (x*_skipLevel)*_obscureFactor] == 255) { //<<< BG-Value - if (x != distance+(_skipLevel-1) && x != _size[0]/_skipLevel-distance-(_skipLevel-1) && // kein rand! - y != distance+(_skipLevel-1) && y != _size[1]/_skipLevel-distance-(_skipLevel-1)) { - point a; a.x=x * _skipLevel; a.y = y * _skipLevel; - _orbit.push_back(a); - //_orbit[orbitcounter].x = x * _skipLevel; - //_orbit[orbitcounter].y = y * _skipLevel; - _orbitcounter++; - } - } - } - } - } + _orbitcounter = 0; + _orbit.clear(); + //orbit.resize( (_size[0]/_skipLevel * _size[1]/_skipLevel) ); + for (x=0; x<_size[0]/_skipLevel; x++) { + for (y=0; y<_size[1]/_skipLevel; y++) { + if (_bufferDT[y*_size[0] + x] == distance) { + if (_bufferID[(y*_skipLevel)*_size[0]*_obscureFactor + (x*_skipLevel)*_obscureFactor] == 255) { //<<< BG-Value + if (x != distance+(_skipLevel-1) && x != _size[0]/_skipLevel-distance-(_skipLevel-1) && // kein rand! + y != distance+(_skipLevel-1) && y != _size[1]/_skipLevel-distance-(_skipLevel-1)) { + point a; a.x=x * _skipLevel; a.y = y * _skipLevel; + _orbit.push_back(a); + //_orbit[orbitcounter].x = x * _skipLevel; + //_orbit[orbitcounter].y = y * _skipLevel; + _orbitcounter++; + } + } + } + } + } } void SoAnnotator::findCandidatesExtLabel() { - findeOrbit(_orbitDistance / _skipLevel); // finde orbit im abstand 20 + findeOrbit(_orbitDistance / _skipLevel); // finde orbit im abstand 20 } bool lineIntersectBox(SbVec2s B1, SbVec2s B2, SbVec2s L1, SbVec2s L2 ) { - // guter quellcode unter: http://www.3dkingdoms.com/weekly/weekly.php?a=3 - if (L2[0] < B1[0] && L1[0] < B1[0] ) return false; - if (L2[0] > B2[0] && L1[0] > B2[0] ) return false; - if (L2[1] < B1[1] && L1[1] < B1[1] ) return false; - if (L2[1] > B2[1] && L1[1] > B2[1] ) return false; - - if (L1[0] > B1[0] && L1[0] < B2[0] && - L1[1] > B1[1] && L1[1] < B2[1] ) return true; - else return false; + // guter quellcode unter: http://www.3dkingdoms.com/weekly/weekly.php?a=3 + if (L2[0] < B1[0] && L1[0] < B1[0] ) return false; + if (L2[0] > B2[0] && L1[0] > B2[0] ) return false; + if (L2[1] < B1[1] && L1[1] < B1[1] ) return false; + if (L2[1] > B2[1] && L1[1] > B2[1] ) return false; + if (L1[0] > B1[0] && L1[0] < B2[0] && + L1[1] > B1[1] && L1[1] < B2[1] ) return true; + else return false; + } bool SoAnnotator::pointInBox(short int boxPosX, short int boxPosY, short int boxDimX, short int boxDimY, short int pointPosX, short int pointPosY) { - if ( pointPosX >= boxPosX - boxDimX && - pointPosX <= boxPosX + boxDimX && + if ( pointPosX >= boxPosX - boxDimX && + pointPosX <= boxPosX + boxDimX && pointPosY >= boxPosY - boxDimY && // - pointPosY <= boxPosY + boxDimY ) { - return true; - } + pointPosY <= boxPosY + boxDimY ) { + return true; + } return false; -} +} //*********************** External Labeling ****************************** -//************************************************************************ +//************************************************************************ void SoAnnotator::evalExtLabels() { - int i, topmostIndex; + int i, topmostIndex; - //legt eine Priorit\xE4tsliste fest, weil im nachhinein greedyalgorithmus - ermittleKonvexeHuelle(); + //legt eine Priorit\xE4tsliste fest, weil im nachhinein greedyalgorithmus + ermittleKonvexeHuelle(); - for (i=0; i<(int)myLabelObjects->size(); i++) { //Enth\xE4lt die Indizes aller Objekte die gelabelt werden sollen sortiert nach kriterien + for (i=0; i<(int)myLabelObjects->size(); i++) { //Enth\xE4lt die Indizes aller Objekte die gelabelt werden sollen sortiert nach kriterien if ((*myLabelObjects)[i]->on) { - //----SETZEN DER ANCHORPOINTS IM OBJEKT - //Erst unsichtbare Objekte, die dennoch belabelt werden sollen - if ((*myLabelObjects)[i]->drawIfInvis==true && (*myLabelObjects)[i]->labelState.isObjectVisible==false) - { - (*myLabelObjects)[i]->labelState.visible=true; - SbVec2s screenCenterBB( floor( (*myLabelObjects)[i]->screenCenterBB.getValue()[0]), floor((*myLabelObjects)[i]->screenCenterBB.getValue()[1]) ); - //liegt Objekt au\xDFerhalb des Bildschirms? - ////std::cout << "evalExtLabels(): is invisible! object=" << (*myLabelObjects)[i]->metkObjId << " screenCenterBB=" << screenCenterBB.getValue()[0] << "," << screenCenterBB.getValue()[1] << " "; - if ( screenCenterBB.getValue()[0] < 0 || screenCenterBB.getValue()[0] > _size[0] || - screenCenterBB.getValue()[1] < 0 || screenCenterBB.getValue()[1] > _size[1]) - { - std::cout << "visible set to FALSE "; - (*myLabelObjects)[i]->labelState.visible = false; //wenn au\xDFerhalb des fensters nicht berechnen - (*myLabelObjects)[i]->referenceLine.comment6="--invisible weil centerBB der Structure au\xDFerhalb des Screens--"; - continue; - } - (*myLabelObjects)[i]->referenceLine.object.setValue( screenCenterBB.getValue() ); - (*myLabelObjects)[i]->referenceLine.anchorType = "screenCenterBB"; + //----SETZEN DER ANCHORPOINTS IM OBJEKT + //Erst unsichtbare Objekte, die dennoch belabelt werden sollen + if ((*myLabelObjects)[i]->drawIfInvis==true && (*myLabelObjects)[i]->labelState.isObjectVisible==false) + { + (*myLabelObjects)[i]->labelState.visible=true; + SbVec2s screenCenterBB( floor( (*myLabelObjects)[i]->screenCenterBB.getValue()[0]), floor((*myLabelObjects)[i]->screenCenterBB.getValue()[1]) ); + //liegt Objekt au\xDFerhalb des Bildschirms? + ////std::cout << "evalExtLabels(): is invisible! object=" << (*myLabelObjects)[i]->metkObjId << " screenCenterBB=" << screenCenterBB.getValue()[0] << "," << screenCenterBB.getValue()[1] << " "; + if ( screenCenterBB.getValue()[0] < 0 || screenCenterBB.getValue()[0] > _size[0] || + screenCenterBB.getValue()[1] < 0 || screenCenterBB.getValue()[1] > _size[1]) + { + std::cout << "visible set to FALSE "; + (*myLabelObjects)[i]->labelState.visible = false; //wenn au\xDFerhalb des fensters nicht berechnen + (*myLabelObjects)[i]->referenceLine.comment6="--invisible weil centerBB der Structure au\xDFerhalb des Screens--"; + continue; + } + (*myLabelObjects)[i]->referenceLine.object.setValue( screenCenterBB.getValue() ); + (*myLabelObjects)[i]->referenceLine.anchorType = "screenCenterBB"; - } - else { - if (agentExternalAnchorStillValid(i, 0, 0) && _useAgents) { // wenn ankerpunkt noch auf objekt - agentExternalAnchorCheckNeighborhoodDF(i); - } else { // andernfalls setze ihn auf ein neues Maximum - (*myLabelObjects)[i]->referenceLine.object.setValue( _maximum[i+1][0].x, _maximum[i+1][0].y ); //_maximum[0]=hintergrund - (*myLabelObjects)[i]->referenceLine.anchorType = "_maximum"; - } - ////std::cout << "evalExtLabels(): is visible object=" << (*myLabelObjects)[i]->metkObjId << " referenclineXY=" << (*myLabelObjects)[i]->referenceLine.object.getValue()[0] <<","<< (*myLabelObjects)[i]->referenceLine.object.getValue()[1]; - } + } + else { + if (agentExternalAnchorStillValid(i, 0, 0) && _useAgents) { // wenn ankerpunkt noch auf objekt + agentExternalAnchorCheckNeighborhoodDF(i); + } else { // andernfalls setze ihn auf ein neues Maximum + (*myLabelObjects)[i]->referenceLine.object.setValue( _maximum[i+1][0].x, _maximum[i+1][0].y ); //_maximum[0]=hintergrund + (*myLabelObjects)[i]->referenceLine.anchorType = "_maximum"; + } + ////std::cout << "evalExtLabels(): is visible object=" << (*myLabelObjects)[i]->metkObjId << " referenclineXY=" << (*myLabelObjects)[i]->referenceLine.object.getValue()[0] <<","<< (*myLabelObjects)[i]->referenceLine.object.getValue()[1]; + } - int bestIdx_labelObject = i; + int bestIdx_labelObject = i; - topmostIndex = scoreExternalLabel(i); - if (topmostIndex == -1) - { - (*myLabelObjects)[bestIdx_labelObject]->labelState.visible = false; //wenn kein platz f\xFCr label - (*myLabelObjects)[bestIdx_labelObject]->referenceLine.comment1 = "--topMostIndex==-1 daher angeblich kein Platz f\xFCr Label--"; - continue; - } - int y; - y=_orbit[topmostIndex].y; - (*myLabelObjects)[i]->refLineNewPos.setValue( _orbit[topmostIndex].x, y );// jetzt noch das \xE4u\xDFere Ende der Refline eintragen - (*myLabelObjects)[i]->labelState.alreadyProcessed = true; - (*myLabelObjects)[i]->referenceLine.orbitIndex = topmostIndex; // achtung nur fix wegen bug - (*myLabelObjects)[i]->extNewOrbitIndex = topmostIndex; - (*myLabelObjects)[i]->referenceLine.label.setValue( _orbit[topmostIndex].x, y ); + topmostIndex = scoreExternalLabel(i); + if (topmostIndex == -1) + { + (*myLabelObjects)[bestIdx_labelObject]->labelState.visible = false; //wenn kein platz f\xFCr label + (*myLabelObjects)[bestIdx_labelObject]->referenceLine.comment1 = "--topMostIndex==-1 daher angeblich kein Platz f\xFCr Label--"; + continue; + } + int y; + y=_orbit[topmostIndex].y; + (*myLabelObjects)[i]->refLineNewPos.setValue( _orbit[topmostIndex].x, y );// jetzt noch das \xE4u\xDFere Ende der Refline eintragen + (*myLabelObjects)[i]->labelState.alreadyProcessed = true; + (*myLabelObjects)[i]->referenceLine.orbitIndex = topmostIndex; // achtung nur fix wegen bug + (*myLabelObjects)[i]->extNewOrbitIndex = topmostIndex; + (*myLabelObjects)[i]->referenceLine.label.setValue( _orbit[topmostIndex].x, y ); } - }//ende durchlauf alle objekte + }//ende durchlauf alle objekte - resolveLineLineIntersections(); - controllIntersections(); + resolveLineLineIntersections(); + controllIntersections(); } int SoAnnotator::scoreExternalLabel(int nr ) { - SbVec2s labelSize; - //float scoreSum[1000], scoreLength[1000], scoreAngle[1000], scoreDelta[1000], scoreNeighbors[1000];// scoreInfoHiding[1000], scoreNeighbors[1000]; - std::vector<float> scoreSum, scoreLength, scoreAngle, scoreDelta, scoreNeighbors, scoreIntersection; - int j, topmostIndex; - short orbitx, orbity, objectx, objecty; - bool isLeft; + SbVec2s labelSize; + //float scoreSum[1000], scoreLength[1000], scoreAngle[1000], scoreDelta[1000], scoreNeighbors[1000];// scoreInfoHiding[1000], scoreNeighbors[1000]; + std::vector<float> scoreSum, scoreLength, scoreAngle, scoreDelta, scoreNeighbors, scoreIntersection; + int j, topmostIndex; + short orbitx, orbity, objectx, objecty; + bool isLeft; - if ( nr<0 || nr >= (int)myLabelObjects->size() ) return -1; + if ( nr<0 || nr >= (int)myLabelObjects->size() ) return -1; - for (j=0; j<_orbitcounter; j++) {//initialisieren - scoreSum.push_back(0); - scoreLength.push_back(0); - scoreAngle.push_back(0); - scoreDelta.push_back(0); - scoreNeighbors.push_back(0); - scoreIntersection.push_back(0); - } + for (j=0; j<_orbitcounter; j++) {//initialisieren + scoreSum.push_back(0); + scoreLength.push_back(0); + scoreAngle.push_back(0); + scoreDelta.push_back(0); + scoreNeighbors.push_back(0); + scoreIntersection.push_back(0); + } - //memset(scoreSum, 0, sizeof(scoreSum)); + //memset(scoreSum, 0, sizeof(scoreSum)); - if (!(*myLabelObjects)[nr]->validTextBoxSize) - { - std::cout << "Invalid TextBoxSize ... recalc?? ... " << (*myLabelObjects)[nr]->metkObjId; - std::cout << " Text waere = " << (*myLabelObjects)[nr]->getLabelText() << std::endl; - } - labelSize = (*myLabelObjects)[nr]->getTextSize();//myExternal[i]->getSize(); - //std::cout << "labelSize=" << labelSize[0] << "," << labelSize[1] << std::endl; + if (!(*myLabelObjects)[nr]->validTextBoxSize) + { + std::cout << "Invalid TextBoxSize ... recalc?? ... " << (*myLabelObjects)[nr]->metkObjId; + std::cout << " Text waere = " << (*myLabelObjects)[nr]->getLabelText() << std::endl; + } + labelSize = (*myLabelObjects)[nr]->getTextSize();//myExternal[i]->getSize(); + //std::cout << "labelSize=" << labelSize[0] << "," << labelSize[1] << std::endl; - objectx = (*myLabelObjects)[nr]->referenceLine.object.getValue()[0]; - objecty = (*myLabelObjects)[nr]->referenceLine.object.getValue()[1]; - if (labelSize[0] <= 0) - { - (*myLabelObjects)[nr]->labelState.visible = false; - (*myLabelObjects)[nr]->referenceLine.comment7="--invisible weil labelSize<=0--"; - std::cout << "XXX " << (*myLabelObjects)[nr]->metkObjId << " --invisible weil labelSize<=0-- " << std::endl; - return -1; // momentan invalid, erst wieder beim n\xE4chsten Pass betrachten - } - for (j=0; j<_orbitcounter; j++) { - orbitx = _orbit[j].x; - orbity = _orbit[j].y; - // wie verl\xE4uft potentielle Referenzlinie? - if (orbitx >= objectx) isLeft = false; // wenn rechts - else isLeft = true; // wenn links - // pr\xFCfe erstmal die Platzierbarkeit: Label<->Object (left/right), Label<->processed Labels, Label<->Boxes - if (validExternalPlacement(orbitx, orbity, labelSize[0], labelSize[1], isLeft)) - { - scoreLength[j] = getExternalReflineLength(objectx, objecty, orbitx, orbity); - scoreAngle[j] = getExternalReflineAngle(objecty, orbity); - scoreDelta[j] = getExternalDelta((*myLabelObjects)[nr]->referenceLine.label.getValue()[0], (*myLabelObjects)[nr]->referenceLine.label.getValue()[1], orbitx, orbity); // alter wert - scoreNeighbors[j] = getExternalNeighborDistance( orbitx, orbity, nr); - scoreIntersection[j] = getExternalIntersectionCount( orbitx, orbity, objectx, objecty, nr); - } - else - { - scoreAngle[j] = 0.0; // kleiner wert als schlecht -> ( 1/differenz der beiden y-werte - scoreLength[j] = scoreDelta[j] = scoreNeighbors[j] = scoreIntersection[j] = 1000.0; // hoher wert als schlecht -> siehe summe - } - } + objectx = (*myLabelObjects)[nr]->referenceLine.object.getValue()[0]; + objecty = (*myLabelObjects)[nr]->referenceLine.object.getValue()[1]; + if (labelSize[0] <= 0) + { + (*myLabelObjects)[nr]->labelState.visible = false; + (*myLabelObjects)[nr]->referenceLine.comment7="--invisible weil labelSize<=0--"; + std::cout << "XXX " << (*myLabelObjects)[nr]->metkObjId << " --invisible weil labelSize<=0-- " << std::endl; + return -1; // momentan invalid, erst wieder beim n\xE4chsten Pass betrachten + } + for (j=0; j<_orbitcounter; j++) { + orbitx = _orbit[j].x; + orbity = _orbit[j].y; + // wie verl\xE4uft potentielle Referenzlinie? + if (orbitx >= objectx) isLeft = false; // wenn rechts + else isLeft = true; // wenn links + // pr\xFCfe erstmal die Platzierbarkeit: Label<->Object (left/right), Label<->processed Labels, Label<->Boxes + if (validExternalPlacement(orbitx, orbity, labelSize[0], labelSize[1], isLeft)) + { + scoreLength[j] = getExternalReflineLength(objectx, objecty, orbitx, orbity); + scoreAngle[j] = getExternalReflineAngle(objecty, orbity); + scoreDelta[j] = getExternalDelta((*myLabelObjects)[nr]->referenceLine.label.getValue()[0], (*myLabelObjects)[nr]->referenceLine.label.getValue()[1], orbitx, orbity); // alter wert + scoreNeighbors[j] = getExternalNeighborDistance( orbitx, orbity, nr); + scoreIntersection[j] = getExternalIntersectionCount( orbitx, orbity, objectx, objecty, nr); + } + else + { + scoreAngle[j] = 0.0; // kleiner wert als schlecht -> ( 1/differenz der beiden y-werte + scoreLength[j] = scoreDelta[j] = scoreNeighbors[j] = scoreIntersection[j] = 1000.0; // hoher wert als schlecht -> siehe summe + } + } - // normalisieren - normalisiere(scoreLength); - normalisiere(scoreAngle); - normalisiere(scoreDelta); - normalisiere(scoreNeighbors); - normalisiere(scoreIntersection); + // normalisieren + normalisiere(scoreLength); + normalisiere(scoreAngle); + normalisiere(scoreDelta); + normalisiere(scoreNeighbors); + normalisiere(scoreIntersection); - // Summe bilden und wichten! - for (j=0; j<_orbitcounter; j++) - { - if ( (*myLabelObjects)[nr]->labelState.isObjectVisible==false && (*myLabelObjects)[nr]->drawIfInvis==true ) - { - scoreSum[j] = (1.0 - scoreLength[j]) * _weight_LengthInvisObj + // gro\xDFer Wert = sehr lang -> schlecht - scoreAngle[j] * _weight_AngleInvisObj + // gro\xDFer Wert = kleiner Winkel -> gut - (1.0 - scoreDelta[j]) * _weight_DeltaInvisObj+ // gro\xDFer wert = gro\xDFe Distanz -> schlecht - (1.0 - scoreNeighbors[j]) * _weight_NeighborInvisObj // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht - +(1.0 - scoreIntersection[j]) * _weight_IntersectionInvisObj; - } - else - { - scoreSum[j] = (1.0 - scoreLength[j]) * _weightExternalLength + // gro\xDFer Wert = sehr lang -> schlecht - scoreAngle[j] * _weightExternalAngle + // gro\xDFer Wert = kleiner Winkel -> gut - (1.0 - scoreDelta[j]) * _weightExternalDelta + // gro\xDFer wert = gro\xDFe Distanz -> schlecht - (1.0 - scoreNeighbors[j]) * _weightExternalNeighbor + // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht - (1.0 - scoreIntersection[j]) * _weight_Intersection; // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht - } - } + // Summe bilden und wichten! + for (j=0; j<_orbitcounter; j++) + { + if ( (*myLabelObjects)[nr]->labelState.isObjectVisible==false && (*myLabelObjects)[nr]->drawIfInvis==true ) + { + scoreSum[j] = (1.0 - scoreLength[j]) * _weight_LengthInvisObj + // gro\xDFer Wert = sehr lang -> schlecht + scoreAngle[j] * _weight_AngleInvisObj + // gro\xDFer Wert = kleiner Winkel -> gut + (1.0 - scoreDelta[j]) * _weight_DeltaInvisObj+ // gro\xDFer wert = gro\xDFe Distanz -> schlecht + (1.0 - scoreNeighbors[j]) * _weight_NeighborInvisObj // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht + +(1.0 - scoreIntersection[j]) * _weight_IntersectionInvisObj; + } + else + { + scoreSum[j] = (1.0 - scoreLength[j]) * _weightExternalLength + // gro\xDFer Wert = sehr lang -> schlecht + scoreAngle[j] * _weightExternalAngle + // gro\xDFer Wert = kleiner Winkel -> gut + (1.0 - scoreDelta[j]) * _weightExternalDelta + // gro\xDFer wert = gro\xDFe Distanz -> schlecht + (1.0 - scoreNeighbors[j]) * _weightExternalNeighbor + // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht + (1.0 - scoreIntersection[j]) * _weight_Intersection; // gro\xDFer Wert = gro\xDFer Abstand (minimale Abstand) -> schlecht + } + } - for (j=0; j<nr-1; j++ ) { // alle schon benutzten Stellen auf score=0 setzen; aber nur die bisher besuchten Knoten einbeziehen - if ( (*myLabelObjects)[ j ]->labelState.alreadyProcessed ) { - scoreSum[ (*myLabelObjects)[ j ]->referenceLine.orbitIndex] = 0.0; - } - } // timo: achtung, noch nicht \xFCberpr\xFCft ob es wirkt + for (j=0; j<nr-1; j++ ) { // alle schon benutzten Stellen auf score=0 setzen; aber nur die bish... [truncated message content] |
From: <wol...@us...> - 2009-06-21 17:23:43
|
Revision: 91 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=91&view=rev Author: wolfspindler Date: 2009-06-21 17:23:35 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -PLatform dependent backslashes replaced by forward slashes. Modified Paths: -------------- trunk/Community/METK/Sources/ML/Animation/AnimationParser/AnimationParser.h Modified: trunk/Community/METK/Sources/ML/Animation/AnimationParser/AnimationParser.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/AnimationParser/AnimationParser.h 2009-06-21 17:21:36 UTC (rev 90) +++ trunk/Community/METK/Sources/ML/Animation/AnimationParser/AnimationParser.h 2009-06-21 17:23:35 UTC (rev 91) @@ -1,10 +1,10 @@ //---------------------------------------------------------------------------------- -/*! +/*! AnimationParser is the class for script parsing. // \file AnimationParser.h // \author Konrad M\xFChler // \date 2005-07-05 // -// +// */ //---------------------------------------------------------------------------------- @@ -24,11 +24,11 @@ #include "kScriptFrameList.h" #include "XMLParser.h" -#include "xercesc\dom\DOMDocument.hpp" -#include "xercesc\dom\DOMNode.hpp" -#include "xercesc\dom\DOMElement.hpp" -#include "xercesc\dom\DOMText.hpp" -#include "xercesc\dom\DOMRange.hpp" +#include "xercesc/dom/DOMDocument.hpp" +#include "xercesc/dom/DOMNode.hpp" +#include "xercesc/dom/DOMElement.hpp" +#include "xercesc/dom/DOMText.hpp" +#include "xercesc/dom/DOMRange.hpp" #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/dom/DOM.hpp> #include <xercesc/dom/DOMImplementation.hpp> @@ -48,7 +48,7 @@ using namespace std; -//! AnimationParser is the class for script parsing. +//! AnimationParser is the class for script parsing. /*! It contains all functions for parsing a script using XML files for command- and object-replacement * * The Library is for script parser and frame management @@ -57,91 +57,91 @@ { private: - //! \defgroup SectionType SectionTypes - //@{ - static const short ST_NONE; //!< Unknown SectionType - static const short ST_INI; //!< Ini-Part - static const short ST_SCRIPT; //!< Script-Part - //@} + //! \defgroup SectionType SectionTypes + //@{ + static const short ST_NONE; //!< Unknown SectionType + static const short ST_INI; //!< Ini-Part + static const short ST_SCRIPT; //!< Script-Part + //@} - static const char DELIMITER_SPACE; //!< Delimiter for parts of commands - - typedef std::list<kScriptCommandObject> COLIST; //!< Typdef for Lists of CommandObjects - - XMLParser myObjectXMLParser1; //!< Parser for first ObjectXML-File - XMLParser myObjectXMLParser2; //!< Parser for second ObjectXML-File - XMLParser myCommandXMLParser; //!< Parser for CommandXML-File - - const char* CommandXMLFileName; //!< FileName of CommandXML-File - const char* ObjectXMLFileName1; //!< FileName of first ObjectXML-File - string ObjectXMLString1; //!< String of first ObjectXML - const char* ObjectXMLFileName2; //!< FileName of second ObjectXML-File + static const char DELIMITER_SPACE; //!< Delimiter for parts of commands + typedef std::list<kScriptCommandObject> COLIST; //!< Typdef for Lists of CommandObjects - //-------------------------------------------------------- - //Functions - //-------------------------------------------------------- - int getReplaceCommandCount(DOMNode* node); - DOMNode* getCommandReplaceNode(DOMNode* root, string CommandStr, int minCommandCount); - DOMNode* getObjectReplaceNode(DOMNode* root, string ObjectStr); - DOMNode* getParamReplaceNode(DOMNode* root, string CommandStr, string ParamStr); - COLIST getCommandList(DOMNode* node); - list<string> getObjectList(DOMNode* node); - bool checkForParamReplace(kScriptIniObject& myIniObject, kScriptCommandObject& CommandObj); - COLIST checkForCommandReplace(kScriptIniObject& myIniObject, kScriptCommandObject CommandObj); - COLIST checkForObjectReplace(kScriptCommandObject CommandObj); - string parseHLScript(iostream& streamHL, ostream& streamLL); - string parseLLScript(iostream& streamLL, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); - void writeDocToXML(const XERCES_CPP_NAMESPACE::DOMDocument* doc, const DOMImplementation* impl, const string fileName); - void writeDocToXMLString(const XERCES_CPP_NAMESPACE::DOMDocument* doc, const DOMImplementation* impl, string* xmlString); - string removeComments(string line); - string XMLCh2String(const XMLCh * xString); + XMLParser myObjectXMLParser1; //!< Parser for first ObjectXML-File + XMLParser myObjectXMLParser2; //!< Parser for second ObjectXML-File + XMLParser myCommandXMLParser; //!< Parser for CommandXML-File + const char* CommandXMLFileName; //!< FileName of CommandXML-File + const char* ObjectXMLFileName1; //!< FileName of first ObjectXML-File + string ObjectXMLString1; //!< String of first ObjectXML + const char* ObjectXMLFileName2; //!< FileName of second ObjectXML-File + + + //-------------------------------------------------------- + //Functions + //-------------------------------------------------------- + int getReplaceCommandCount(DOMNode* node); + DOMNode* getCommandReplaceNode(DOMNode* root, string CommandStr, int minCommandCount); + DOMNode* getObjectReplaceNode(DOMNode* root, string ObjectStr); + DOMNode* getParamReplaceNode(DOMNode* root, string CommandStr, string ParamStr); + COLIST getCommandList(DOMNode* node); + list<string> getObjectList(DOMNode* node); + bool checkForParamReplace(kScriptIniObject& myIniObject, kScriptCommandObject& CommandObj); + COLIST checkForCommandReplace(kScriptIniObject& myIniObject, kScriptCommandObject CommandObj); + COLIST checkForObjectReplace(kScriptCommandObject CommandObj); + string parseHLScript(iostream& streamHL, ostream& streamLL); + string parseLLScript(iostream& streamLL, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); + void writeDocToXML(const XERCES_CPP_NAMESPACE::DOMDocument* doc, const DOMImplementation* impl, const string fileName); + void writeDocToXMLString(const XERCES_CPP_NAMESPACE::DOMDocument* doc, const DOMImplementation* impl, string* xmlString); + string removeComments(string line); + string XMLCh2String(const XMLCh * xString); + protected: - virtual ~AnimationParser(); + virtual ~AnimationParser(); public: - //-------------------------------------------------------- - //Functions - //-------------------------------------------------------- - AnimationParser(); - string setCommandXMLFileName(const char* value); - string getCommandXMLFileName(); - string setObjectXML1FileName(const char* file1); - string getObjectXML1FileName(); - string setObjectXML1String(string xmlString); - string getObjectXML1String(); - string setObjectXML2FileName(const char* file2); - string getObjectXML2FileName(); + //-------------------------------------------------------- + //Functions + //-------------------------------------------------------- + AnimationParser(); + string setCommandXMLFileName(const char* value); + string getCommandXMLFileName(); + string setObjectXML1FileName(const char* file1); + string getObjectXML1FileName(); + string setObjectXML1String(string xmlString); + string getObjectXML1String(); + string setObjectXML2FileName(const char* file2); + string getObjectXML2FileName(); - string openAndParseLLScript(const char* LLFileName, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); - string openAndParseLLStream(stringstream& LLScript, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); - string openAndParseHLScript(const char* HLFileName, const char* LLFileName); - string openAndParseHLStream(stringstream& HLScript, ostream& LLScript); - - void getObjectStringList(const char* objectName, std::vector<string>* returnStringList); - void getObjectStringList(const char* objectName, HashTable<string>* returnStringList); - void createNewObjectXMLFile(const char* fileName); - void createNewObjectXMLString(string* xmlString); - void createNewCommandXMLFile(const char* fileName); - void createNewCommandXMLString(string* xmlString); - void addObjectToXMLFile(const string fileName, const string orgObject, const list<string>* replaceObjectList); - void addObjectToXMLString(string* xmlString, const string orgObject, const list<string>* replaceObjectList); + string openAndParseLLScript(const char* LLFileName, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); + string openAndParseLLStream(stringstream& LLScript, kScriptIniObject* iniObject, list<kScriptCommandObject>* LLCommandList); + string openAndParseHLScript(const char* HLFileName, const char* LLFileName); + string openAndParseHLStream(stringstream& HLScript, ostream& LLScript); - string parseObjectCommand(const char *objectLine, std::vector<string>* returnStringList); + void getObjectStringList(const char* objectName, std::vector<string>* returnStringList); + void getObjectStringList(const char* objectName, HashTable<string>* returnStringList); + void createNewObjectXMLFile(const char* fileName); + void createNewObjectXMLString(string* xmlString); + void createNewCommandXMLFile(const char* fileName); + void createNewCommandXMLString(string* xmlString); + void addObjectToXMLFile(const string fileName, const string orgObject, const list<string>* replaceObjectList); + void addObjectToXMLString(string* xmlString, const string orgObject, const list<string>* replaceObjectList); - //! \defgroup Errors - //@{ - static const string ERROR_NONE; //!< No error, all ok - static const string ERROR_OPEN_LOWLEVEL; //!< Error opening lowlevel file / file not found? - static const string ERROR_OPEN_HIGHLEVEL; //!< Error opening highlevel file / file not found? - static const string ERROR_OPEN_OBJECTXML1; //!< Error opening object xml file 1 / file not found? - static const string ERROR_OPEN_OBJECTXML2; //!< Error opening object xml file 2 / file not found? - static const string ERROR_OPEN_COMMANDXML; //!< Error opening command xml file / file not found? - static const string ERROR_CREATE_LOWLEVEL; //!< Error create lowlevel file! - static const string ERROR_INI_HIGHLEVEL; //!< Error in ini part of high level script! - static const string ERROR_INI_LOWLEVEL; //!< Error in ini part of low level script! - //@} + string parseObjectCommand(const char *objectLine, std::vector<string>* returnStringList); + + //! \defgroup Errors + //@{ + static const string ERROR_NONE; //!< No error, all ok + static const string ERROR_OPEN_LOWLEVEL; //!< Error opening lowlevel file / file not found? + static const string ERROR_OPEN_HIGHLEVEL; //!< Error opening highlevel file / file not found? + static const string ERROR_OPEN_OBJECTXML1; //!< Error opening object xml file 1 / file not found? + static const string ERROR_OPEN_OBJECTXML2; //!< Error opening object xml file 2 / file not found? + static const string ERROR_OPEN_COMMANDXML; //!< Error opening command xml file / file not found? + static const string ERROR_CREATE_LOWLEVEL; //!< Error create lowlevel file! + static const string ERROR_INI_HIGHLEVEL; //!< Error in ini part of high level script! + static const string ERROR_INI_LOWLEVEL; //!< Error in ini part of low level script! + //@} }; -#endif // _ANIMATIONPARSERDLL_ \ No newline at end of file +#endif // _ANIMATIONPARSERDLL_ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-21 17:21:40
|
Revision: 90 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=90&view=rev Author: wolfspindler Date: 2009-06-21 17:21:36 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Invalid characters removed from first line. Modified Paths: -------------- trunk/Community/METK/Sources/ML/Animation/UMDCampath/GoogleCampath.h Modified: trunk/Community/METK/Sources/ML/Animation/UMDCampath/GoogleCampath.h =================================================================== --- trunk/Community/METK/Sources/ML/Animation/UMDCampath/GoogleCampath.h 2009-06-21 17:02:54 UTC (rev 89) +++ trunk/Community/METK/Sources/ML/Animation/UMDCampath/GoogleCampath.h 2009-06-21 17:21:36 UTC (rev 90) @@ -1,4 +1,4 @@ -#ifndef _GOOGLECAMPATH_ +#ifndef _GOOGLECAMPATH_ #define _GOOGLECAMPATH_ #include "UMDCampath.h" @@ -6,11 +6,11 @@ ML_START_NAMESPACE class GoogleCampath:public AbstractCampath{ - public: - GoogleCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, - vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); - ~GoogleCampath(); - void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&); + public: + GoogleCampath(ObjMgrCommunicator*,StringField*,kScriptFrameList*,kCamera*,AnimationCache*, + vector<SbVec3f>*,Vec3fField*,DoubleField*,Vec3fField*,BoolField*,const std::string&); + ~GoogleCampath(); + void internCalcPositions(SbVec3f* bbc,double,double,SbVec3f*,SbVec3f*,SbVec3f*,double,SbVec3f*,SbVec3f&,SbVec3f&,double&); }; ML_END_NAMESPACE #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-21 17:03:03
|
Revision: 89 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=89&view=rev Author: wolfspindler Date: 2009-06-21 17:02:54 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Ambiguous and platform dependent operator use replaced by explicit function call. Modified Paths: -------------- trunk/Community/METK/Sources/common/ObjMgrCommunicator.cpp Modified: trunk/Community/METK/Sources/common/ObjMgrCommunicator.cpp =================================================================== --- trunk/Community/METK/Sources/common/ObjMgrCommunicator.cpp 2009-06-21 16:12:10 UTC (rev 88) +++ trunk/Community/METK/Sources/common/ObjMgrCommunicator.cpp 2009-06-21 17:02:54 UTC (rev 89) @@ -15,236 +15,238 @@ void ObjMgrCommunicator::handleObjMgrNotification() { - omEventContainer myEventList = getEventContainer(); + omEventContainer myEventList = getEventContainer(); - //Durchiterieren der EventList - omEventContainer::const_iterator iter; - for ( iter = myEventList.begin();iter!=myEventList.end(); iter++) - { - ObjMgrEvent myEvent = (*iter); - - //if (myEvent.objectID==fldAnimationViewerName->getStringValue() && myEvent.layerID==LAY_VIEWER_PROPERTIES && myEvent.infoID==INF_VIEWER_PROPERTIES_VIEWERSTATUS) - } - clearEventContainer(); + //Durchiterieren der EventList + omEventContainer::const_iterator iter; + for ( iter = myEventList.begin();iter!=myEventList.end(); iter++) + { + ObjMgrEvent myEvent = (*iter); + + //if (myEvent.objectID==fldAnimationViewerName->getStringValue() && myEvent.layerID==LAY_VIEWER_PROPERTIES && myEvent.infoID==INF_VIEWER_PROPERTIES_VIEWERSTATUS) + } + clearEventContainer(); } //!Set the value of an attribute in the ObjMgr-DB - no Notification will be send void ObjMgrCommunicator::setObjAttribute(const string ObjID, const string LayerID, const string InfoID, void* value, const string omInfoType, const bool createIfNotExists, const bool persistent, const bool ignoreType) -{ - // Get writable access to object container - bool attrCreated = false; - omObjectContainer* oc = getObjContainer(); - if(oc == NULL) - { - kDebug::Debug("ObjContainer not found!",kDebug::DL_LOW); - } - else - { - if (!(*oc).exists(ObjID) && !createIfNotExists) - { - kDebug::Debug("invalidObject "+ObjID,kDebug::DL_LOW); - } - else - { - omObject& obj = (*oc)[ObjID]; +{ + // Get writable access to object container + bool attrCreated = false; + omObjectContainer* oc = getObjContainer(); + if(oc == NULL) + { + kDebug::Debug("ObjContainer not found!",kDebug::DL_LOW); + } + else + { + if (!(*oc).exists(ObjID) && !createIfNotExists) + { + kDebug::Debug("invalidObject "+ObjID,kDebug::DL_LOW); + } + else + { + omObject& obj = (*oc)[ObjID]; - omAttribute& attr = obj.getAttribute(LayerID,InfoID); - - if (!obj.hasAttribute(LayerID,InfoID) && createIfNotExists) - { - attr.createDataType(omInfoType); - attrCreated = true; - } - if (obj.hasAttribute(LayerID,InfoID)) - { - if (string(attr.getDataType()->getName())!=omInfoType && !ignoreType) - { - obj.removeAttribute(LayerID,InfoID); - attr.createDataType(omInfoType); - attrCreated = true; - } - } - - attr.flags().markPersistent(persistent); + omAttribute& attr = obj.getAttribute(LayerID,InfoID); - //Diese Sache mit den void*-Pointern zur Verallgemeinerung wird uns irgendwann mal m\xE4chtig um die Ohren fliegen ... - if (omInfoType == omINFOTYPE_STRING) - { - obj[LayerID][InfoID].setStringValue(*((string *)value)); - } - else if (omInfoType == omINFOTYPE_DOUBLE) - { - const double oldV = obj[LayerID][InfoID]; - const double newV = *((double *)value); - if (fabs(oldV-newV)>=0.000001f || attrCreated) - obj[LayerID][InfoID] = *((double *)value); - } - else if (omInfoType == omINFOTYPE_INT32) - { - const double oldV = obj[LayerID][InfoID]; - const double newV = *((int *)value); - if (fabs(oldV-newV)>=0 || attrCreated) - obj[LayerID][InfoID] = *((int *)value); - } - else if (omInfoType == omINFOTYPE_VEC3) - { - const vec3 tempVec3 = *(vec3*)value; - const SbVec3f oldV = SbVec3f(double(((vec3)obj[LayerID][InfoID])[0]),double(((vec3)obj[LayerID][InfoID])[1]),double(((vec3)obj[LayerID][InfoID])[2])); - const SbVec3f newV = SbVec3f(double(tempVec3[0]),double(tempVec3[1]),double(tempVec3[2])); + if (!obj.hasAttribute(LayerID,InfoID) && createIfNotExists) + { + attr.createDataType(omInfoType); + attrCreated = true; + } + if (obj.hasAttribute(LayerID,InfoID)) + { + if (string(attr.getDataType()->getName())!=omInfoType && !ignoreType) + { + obj.removeAttribute(LayerID,InfoID); + attr.createDataType(omInfoType); + attrCreated = true; + } + } - if(kBasics::maxDiff(oldV,newV)>=0.000001f || attrCreated) - { - obj[LayerID][InfoID] = tempVec3; - } - } - else if (omInfoType == omINFOTYPE_VEC4) - { - const vec4 tempVec4 = *(vec4*)value; - const SbVec4f oldV = SbVec4f(((vec4)obj[LayerID][InfoID])[0],((vec4)obj[LayerID][InfoID])[1],((vec4)obj[LayerID][InfoID])[2],((vec4)obj[LayerID][InfoID])[3]); - const SbVec4f newV = SbVec4f(tempVec4[0],tempVec4[1],tempVec4[2],tempVec4[3]); + attr.flags().markPersistent(persistent); - if (kBasics::maxDiff(oldV,newV)>=0.000001f || attrCreated) - obj[LayerID][InfoID] = tempVec4; - } - else if (omInfoType == omINFOTYPE_BOOL) - { - const bool oldV = obj[LayerID][InfoID]; - if (oldV!=*(bool *)value || attrCreated) - obj[LayerID][InfoID] = *(bool *)value; - } - else if (omInfoType == omINFOTYPE_MESSAGE) - { - obj[LayerID][InfoID] = *((omMessage *)value); - } - } + //Diese Sache mit den void*-Pointern zur Verallgemeinerung wird uns irgendwann mal m\xE4chtig um die Ohren fliegen ... + if (omInfoType == omINFOTYPE_STRING) + { + obj[LayerID][InfoID].setStringValue(*((string *)value)); + } + else if (omInfoType == omINFOTYPE_DOUBLE) + { + const double oldV = obj[LayerID][InfoID]; + const double newV = *((double *)value); + if (fabs(oldV-newV)>=0.000001f || attrCreated) + obj[LayerID][InfoID] = *((double *)value); + } + else if (omInfoType == omINFOTYPE_INT32) + { + const double oldV = obj[LayerID][InfoID]; + const double newV = *((int *)value); + if (fabs(oldV-newV)>=0 || attrCreated) + obj[LayerID][InfoID] = *((int *)value); + } + else if (omInfoType == omINFOTYPE_VEC3) + { + const vec3 tempVec3 = *(vec3*)value; + const vec3 objVec3 = obj[LayerID][InfoID].get_vec3(); + const SbVec3f oldV = SbVec3f(objVec3[0],objVec3[1],objVec3[2]); + const SbVec3f newV = SbVec3f(tempVec3[0],tempVec3[1],tempVec3[2]); - } + if(kBasics::maxDiff(oldV,newV)>=0.000001f || attrCreated) + { + obj[LayerID][InfoID] = tempVec3; + } + } + else if (omInfoType == omINFOTYPE_VEC4) + { + const vec4 tempVec4 = *(vec4*)value; + const vec4 objVec4 = obj[LayerID][InfoID].get_vec4(); + const SbVec4f oldV = SbVec4f(objVec4[0],objVec4[1],objVec4[2],objVec4[3]); + const SbVec4f newV = SbVec4f(tempVec4[0],tempVec4[1],tempVec4[2],tempVec4[3]); + + if (kBasics::maxDiff(oldV,newV)>=0.000001f || attrCreated) + obj[LayerID][InfoID] = tempVec4; + } + else if (omInfoType == omINFOTYPE_BOOL) + { + const bool oldV = obj[LayerID][InfoID]; + if (oldV!=*(bool *)value || attrCreated) + obj[LayerID][InfoID] = *(bool *)value; + } + else if (omInfoType == omINFOTYPE_MESSAGE) + { + obj[LayerID][InfoID] = *((omMessage *)value); + } + } + + } } bool ObjMgrCommunicator::getObjAttribute(const string ObjID, const string LayerID, const string InfoID, omAttribute& attr) { - const omObjectContainer *oc= getConstObjContainer(); - if(oc == NULL) - { - kDebug::Debug("ObjContainer not found!",kDebug::DL_LOW); - } - else - { - if (!(*oc).exists(ObjID)) - { - kDebug::Debug("invalidObject",kDebug::DL_LOW); - } - else - { - // Get read-only access to object with given ID. - const omObject &obj= (*oc)[ObjID]; - if (obj.hasAttribute(LayerID,InfoID)) - { - attr = obj.getAttribute(LayerID,InfoID); - return true; - } - } - } - return false; + const omObjectContainer *oc= getConstObjContainer(); + if(oc == NULL) + { + kDebug::Debug("ObjContainer not found!",kDebug::DL_LOW); + } + else + { + if (!(*oc).exists(ObjID)) + { + kDebug::Debug("invalidObject",kDebug::DL_LOW); + } + else + { + // Get read-only access to object with given ID. + const omObject &obj= (*oc)[ObjID]; + if (obj.hasAttribute(LayerID,InfoID)) + { + attr = obj.getAttribute(LayerID,InfoID); + return true; + } + } + } + return false; } bool ObjMgrCommunicator::getObjAttributeVec3f(const string ObjID, const string LayerID, const string InfoID, SbVec3f& vec3f) { - omAttribute attr; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - vector<string> VecSplit; - kBasics::split(attr.getStringValue(),' ',3,&VecSplit); + omAttribute attr; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + vector<string> VecSplit; + kBasics::split(attr.getStringValue(),' ',3,&VecSplit); - if (VecSplit.size()!=3) - { - kDebug::Debug("WrongSplitSize: " + kBasics::IntToString(VecSplit.size()),kDebug::DL_HIGH); - return false; - } + if (VecSplit.size()!=3) + { + kDebug::Debug("WrongSplitSize: " + kBasics::IntToString(VecSplit.size()),kDebug::DL_HIGH); + return false; + } - vec3f.setValue(kBasics::StringToFloat(VecSplit[0]),kBasics::StringToFloat(VecSplit[1]),kBasics::StringToFloat(VecSplit[2])); - return true; - } - return false; + vec3f.setValue(kBasics::StringToFloat(VecSplit[0]),kBasics::StringToFloat(VecSplit[1]),kBasics::StringToFloat(VecSplit[2])); + return true; + } + return false; } bool ObjMgrCommunicator::getObjAttributeVec4f(const string ObjID, const string LayerID, const string InfoID, SbVec4f& vec4f) { - omAttribute attr; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - vector<string> VecSplit; - kBasics::split(attr.getStringValue(),' ',4,&VecSplit); + omAttribute attr; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + vector<string> VecSplit; + kBasics::split(attr.getStringValue(),' ',4,&VecSplit); - if (VecSplit.size()!=4) - { - kDebug::Debug("WrongSplitSize: " + kBasics::IntToString(VecSplit.size()),kDebug::DL_HIGH); - return false; - } + if (VecSplit.size()!=4) + { + kDebug::Debug("WrongSplitSize: " + kBasics::IntToString(VecSplit.size()),kDebug::DL_HIGH); + return false; + } - vec4f.setValue(kBasics::StringToFloat(VecSplit[0]),kBasics::StringToFloat(VecSplit[1]),kBasics::StringToFloat(VecSplit[2]),kBasics::StringToFloat(VecSplit[3])); - return true; - } - return false; + vec4f.setValue(kBasics::StringToFloat(VecSplit[0]),kBasics::StringToFloat(VecSplit[1]),kBasics::StringToFloat(VecSplit[2]),kBasics::StringToFloat(VecSplit[3])); + return true; + } + return false; } bool ObjMgrCommunicator::getObjAttributeString(const string ObjID, const string LayerID, const string InfoID, string& value) { - omAttribute attr; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - value = attr.getStringValue(); - return true; - } - return false; + omAttribute attr; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + value = attr.getStringValue(); + return true; + } + return false; } bool ObjMgrCommunicator::getObjAttributeFloat(const string ObjID, const string LayerID, const string InfoID, float& value) { - omAttribute attr; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - value = kBasics::StringToFloat(attr.getStringValue()); - return true; - } - return false; + omAttribute attr; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + value = kBasics::StringToFloat(attr.getStringValue()); + return true; + } + return false; } bool ObjMgrCommunicator::getObjAttributeInt(const string ObjID, const string LayerID, const string InfoID, int& value) { - omAttribute attr; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - value = kBasics::StringToInt(attr.getStringValue()); - return true; - } - return false; + omAttribute attr; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + value = kBasics::StringToInt(attr.getStringValue()); + return true; + } + return false; } bool ObjMgrCommunicator::getObjAttributeBool(const string ObjID, const string LayerID, const string InfoID, bool& value) { - omAttribute attr; - value = false; - if (getObjAttribute(ObjID,LayerID,InfoID, attr)) - { - value = kBasics::StringToBool(attr.getStringValue()); - return true; - } - return false; + omAttribute attr; + value = false; + if (getObjAttribute(ObjID,LayerID,InfoID, attr)) + { + value = kBasics::StringToBool(attr.getStringValue()); + return true; + } + return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-21 16:12:12
|
Revision: 88 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=88&view=rev Author: wolfspindler Date: 2009-06-21 16:12:10 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Trial to solve a platform dependent code fragment. Modified Paths: -------------- trunk/Community/METK/Sources/common/kBasics.cpp Modified: trunk/Community/METK/Sources/common/kBasics.cpp =================================================================== --- trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-21 15:56:03 UTC (rev 87) +++ trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-21 16:12:10 UTC (rev 88) @@ -4,10 +4,14 @@ // \author Konrad M\xFChler // \date 2005-07-05 // -// +// */ //---------------------------------------------------------------------------------- +#ifndef WIN32 + // Include some ML tools to resolve platform dependencies. + #include "mlUtils.h" +#endif //#include "stdafx.h"//muss mit rein und hat was mit vorkompilierten headern zu tun #include "kBasics.h" @@ -15,405 +19,405 @@ namespace kBasics { - //! Splits a string at a delimiter and returns a vector of parts. - //! \param toSplit[in] source string - //! \param delimiter[in] delimiter string - //! \param max_size[in] maximum number of parts (-1 = unlimited) - //! \param strVector[out] pointer to target vector - void split(const string toSplit,const char delimiter, const int max_size, vector<string>* strVector) - { - string::size_type oldID = 0, newID = 0; - int split_size=1; - strVector->clear(); - while((newID = toSplit.find(delimiter, oldID)) != string::npos && (split_size<max_size || max_size==-1)) - { - strVector->push_back(toSplit.substr(oldID, newID - oldID)); - oldID = newID + 1; - split_size++; - } - strVector->push_back(toSplit.substr(oldID)); - } + //! Splits a string at a delimiter and returns a vector of parts. + //! \param toSplit[in] source string + //! \param delimiter[in] delimiter string + //! \param max_size[in] maximum number of parts (-1 = unlimited) + //! \param strVector[out] pointer to target vector + void split(const string toSplit,const char delimiter, const int max_size, vector<string>* strVector) + { + string::size_type oldID = 0, newID = 0; + int split_size=1; + strVector->clear(); + while((newID = toSplit.find(delimiter, oldID)) != string::npos && (split_size<max_size || max_size==-1)) + { + strVector->push_back(toSplit.substr(oldID, newID - oldID)); + oldID = newID + 1; + split_size++; + } + strVector->push_back(toSplit.substr(oldID)); + } - //! Splits a string at a delimiter under respect of Quationmarks (') and returns a vector of parts - /*! \param toSplit - * \param delimiter - * \param strVector[out] - */ - void splitQuotated(const string toSplit, const char delimiter, const char quotationmark, vector<string>* strVector) - { - vector<string> splitted; - split(toSplit,delimiter,1000,&splitted); //MAX_INT toDo - for (vector<string>::size_type i=0; i<splitted.size(); i++) - { - //if (((string)splitted[i])[0]=='\'') - if (((string)splitted[i])[0]==quotationmark) - { - string tempStr = ""; - tempStr = tempStr + splitted[i]; + //! Splits a string at a delimiter under respect of Quationmarks (') and returns a vector of parts + /*! \param toSplit + * \param delimiter + * \param strVector[out] + */ + void splitQuotated(const string toSplit, const char delimiter, const char quotationmark, vector<string>* strVector) + { + vector<string> splitted; + split(toSplit,delimiter,1000,&splitted); //MAX_INT toDo + for (vector<string>::size_type i=0; i<splitted.size(); i++) + { + //if (((string)splitted[i])[0]=='\'') + if (((string)splitted[i])[0]==quotationmark) + { + string tempStr = ""; + tempStr = tempStr + splitted[i]; - if (splitted[i][splitted[i].size()-1]!=quotationmark) - { - do - { - i++; - tempStr = tempStr + " " + splitted[i]; - } while ( i<splitted.size() && splitted[i].find(quotationmark, 0)==string::npos ); - } - strVector->push_back(tempStr); - } - else - { - strVector->push_back(splitted[i]); - } - } - } + if (splitted[i][splitted[i].size()-1]!=quotationmark) + { + do + { + i++; + tempStr = tempStr + " " + splitted[i]; + } while ( i<splitted.size() && splitted[i].find(quotationmark, 0)==string::npos ); + } + strVector->push_back(tempStr); + } + else + { + strVector->push_back(splitted[i]); + } + } + } - //! Converts a char-pointer to string, to handle possible null pointers - //! \param value - //! \return const string - const string CharToString(const char* value) - { - if (value!=NULL) - { - return string(value); - } - return ""; - } + //! Converts a char-pointer to string, to handle possible null pointers + //! \param value + //! \return const string + const string CharToString(const char* value) + { + if (value!=NULL) + { + return string(value); + } + return ""; + } - //! Converts a string into an int - /*! \param value - * \return int - */ - const int StringToInt(const string value) - { - int intVal = atoi(value.c_str()); - return intVal; - } + //! Converts a string into an int + /*! \param value + * \return int + */ + const int StringToInt(const string value) + { + int intVal = atoi(value.c_str()); + return intVal; + } - //! Converts an int into a string - /*! \param value - * \return string - */ - const string IntToString(const int value) - { - stringstream sstr; - sstr << value; - string strVal = sstr.str(); - return strVal; - } + //! Converts an int into a string + /*! \param value + * \return string + */ + const string IntToString(const int value) + { + stringstream sstr; + sstr << value; + string strVal = sstr.str(); + return strVal; + } - //! Converts a string into a float - /*! F\xFChrte bei mehrfach-Anwendung speziell bei V3-Parametern Crahs-On-Close - * \param value - * \return float - */ - float StringToFloat(const string value) - { - float floatVal; - floatVal = atof(value.c_str()); - return floatVal; - } + //! Converts a string into a float + /*! F\xFChrte bei mehrfach-Anwendung speziell bei V3-Parametern Crahs-On-Close + * \param value + * \return float + */ + float StringToFloat(const string value) + { + float floatVal; + floatVal = atof(value.c_str()); + return floatVal; + } - //! Converts a float into a string - //! \param value - //! \return string - const string FloatToString(const float value) - { - stringstream sstr; - sstr << value; - string strVal = sstr.str(); - return strVal; - } + //! Converts a float into a string + //! \param value + //! \return string + const string FloatToString(const float value) + { + stringstream sstr; + sstr << value; + string strVal = sstr.str(); + return strVal; + } - //! Converts a string into a double - /*! \param value - * \return double - */ - double StringToDouble(const string value) - { - double doubleVal; - doubleVal = atof(value.c_str()); - return doubleVal; - } + //! Converts a string into a double + /*! \param value + * \return double + */ + double StringToDouble(const string value) + { + double doubleVal; + doubleVal = atof(value.c_str()); + return doubleVal; + } - //! Converts a double into a string - /*! \param value - * \return string - */ - const string DoubleToString(const double value) - { - stringstream sstr; - sstr << value; - string strVal = sstr.str(); - return strVal; - } + //! Converts a double into a string + /*! \param value + * \return string + */ + const string DoubleToString(const double value) + { + stringstream sstr; + sstr << value; + string strVal = sstr.str(); + return strVal; + } - //! Converts a bool into a string - /*! \param value - * \return string - */ - const string BoolToString(const bool value) - { - string strVal; - if (value) strVal="true"; else strVal="false"; - return strVal; - } + //! Converts a bool into a string + /*! \param value + * \return string + */ + const string BoolToString(const bool value) + { + string strVal; + if (value) strVal="true"; else strVal="false"; + return strVal; + } - const bool StringToBool(const string value) - { - return toUp(value)=="TRUE"; - } + const bool StringToBool(const string value) + { + return toUp(value)=="TRUE"; + } - //! Deletes all substrings (toDelete) in a string and returns the result - /*! \param toDelete - * \param orgString - * \return string - */ - const string eraseStrPart(const string toDelete, string orgString) - { - if (orgString.find(toDelete,0)!=string::npos) - { - orgString.erase(orgString.find(toDelete, 0),toDelete.length()); - } - return orgString; - } + //! Deletes all substrings (toDelete) in a string and returns the result + /*! \param toDelete + * \param orgString + * \return string + */ + const string eraseStrPart(const string toDelete, string orgString) + { + if (orgString.find(toDelete,0)!=string::npos) + { + orgString.erase(orgString.find(toDelete, 0),toDelete.length()); + } + return orgString; + } - //! Replaces all substrings with a replacement - /*! \param[in,out] s original string - * \param[in] value string to replace - * \param[in] replacement - */ - const string replaceString(string s, const string value, const string replacement) - { - unsigned u = 0; - while ((u=s.find(value, u)) != string::npos) - { - s.replace (u, value.size(), replacement); - u+=replacement.size(); - u--; - } - return s; - } + //! Replaces all substrings with a replacement + /*! \param[in,out] s original string + * \param[in] value string to replace + * \param[in] replacement + */ + const string replaceString(string s, const string value, const string replacement) + { + unsigned u = 0; + while ((u=s.find(value, u)) != string::npos) + { + s.replace (u, value.size(), replacement); + u+=replacement.size(); + u--; + } + return s; + } - //! Replaces all chars with a replacement - /*! \param[in,out] s original string - * \param[in] value char to replace - * \param[in] replacement - */ - const string replaceString(string s, const char value, const string replacement) - { - unsigned u = 0; - while ((u=s.find(value, u)) != string::npos) - { - s.replace (u, 1, replacement); - u+=replacement.size(); - u--; - } - return s; - } + //! Replaces all chars with a replacement + /*! \param[in,out] s original string + * \param[in] value char to replace + * \param[in] replacement + */ + const string replaceString(string s, const char value, const string replacement) + { + unsigned u = 0; + while ((u=s.find(value, u)) != string::npos) + { + s.replace (u, 1, replacement); + u+=replacement.size(); + u--; + } + return s; + } - //! Trim a string by deleting all pre- and postfix spaces - /*! \param s[in,out] string to trim - */ - const string trimString(string s, char c) - { - while (s[0]==c) - { - s=s.substr(1,s.size()); - } + //! Trim a string by deleting all pre- and postfix spaces + /*! \param s[in,out] string to trim + */ + const string trimString(string s, char c) + { + while (s[0]==c) + { + s=s.substr(1,s.size()); + } - while (s[s.size()-1]==c) - { - s=s.substr(0,s.size()-1); - } - return s; - } + while (s[s.size()-1]==c) + { + s=s.substr(0,s.size()-1); + } + return s; + } - /* const string trimStringLFCR(string s) - { - while (s[0]=='\n') - { - s=s.substr(1,s.size()); - } + /* const string trimStringLFCR(string s) + { + while (s[0]=='\n') + { + s=s.substr(1,s.size()); + } - while (s[s.size()-1]==chr(13) || s[s.size()-1]==chr(10)) - { - s=s.substr(0,s.size()-1); - } - return s; - }*/ + while (s[s.size()-1]==chr(13) || s[s.size()-1]==chr(10)) + { + s=s.substr(0,s.size()-1); + } + return s; + }*/ - //! Deletes the quotation marks - /*! \param value[in,out] string to trim */ - const string trimQuotatedStr(string value, const char quotationmark) - { - value = replaceString(value, quotationmark, " "); - value = trimString(value); - return value; - } + //! Deletes the quotation marks + /*! \param value[in,out] string to trim */ + const string trimQuotatedStr(string value, const char quotationmark) + { + value = replaceString(value, quotationmark, " "); + value = trimString(value); + return value; + } - //! Extract the path out of a string - /*! char(92) == '\' - * \param value string with path information - * \param slash char for dividing - */ - const string getPath(const string value, const char slash) - { - string::size_type index = value.find_last_of(slash); // char(92) == '\' + //! Extract the path out of a string + /*! char(92) == '\' + * \param value string with path information + * \param slash char for dividing + */ + const string getPath(const string value, const char slash) + { + string::size_type index = value.find_last_of(slash); // char(92) == '\' - return value.substr(0,index); - } + return value.substr(0,index); + } - //! Extract the filename out of a string - /*! char(92) == '\' - * \param value string with path and filename - * \param slash char for dividing - */ - const string getFilename(const string value, const char slash) - { - string::size_type index = value.find_last_of(slash); // char(92) == '\' + //! Extract the filename out of a string + /*! char(92) == '\' + * \param value string with path and filename + * \param slash char for dividing + */ + const string getFilename(const string value, const char slash) + { + string::size_type index = value.find_last_of(slash); // char(92) == '\' - return value.substr(index+1,value.size()); - } + return value.substr(index+1,value.size()); + } - //! Converts a Vec3 to a string - /*! \param value - */ - const string Vec3fToString(SbVec3f value, const char delimiter) - { - return DoubleToString(value[0])+delimiter+DoubleToString(value[1])+delimiter+DoubleToString(value[2]); - } + //! Converts a Vec3 to a string + /*! \param value + */ + const string Vec3fToString(SbVec3f value, const char delimiter) + { + return DoubleToString(value[0])+delimiter+DoubleToString(value[1])+delimiter+DoubleToString(value[2]); + } - const string Vec3fToString(SbVec3f value) - { - return Vec3fToString(value, ' '); - } + const string Vec3fToString(SbVec3f value) + { + return Vec3fToString(value, ' '); + } - //! Converts a string with space to a Vec3 - /*! \param value - */ - const SbVec3f StringToVec3f(const string value, const char delimiter) - { - vector<string> tempVec; - if (value!="") - { - split(value, delimiter, 3, &tempVec); - if (tempVec.size()==3) - { - SbVec3f myVec3f; - myVec3f.setValue(StringToFloat(tempVec[0]),StringToFloat(tempVec[1]),StringToFloat(tempVec[2])); - return myVec3f; - } - } - return 0; - } + //! Converts a string with space to a Vec3 + /*! \param value + */ + const SbVec3f StringToVec3f(const string value, const char delimiter) + { + vector<string> tempVec; + if (value!="") + { + split(value, delimiter, 3, &tempVec); + if (tempVec.size()==3) + { + SbVec3f myVec3f; + myVec3f.setValue(StringToFloat(tempVec[0]),StringToFloat(tempVec[1]),StringToFloat(tempVec[2])); + return myVec3f; + } + } + return 0; + } - //! Converts a SbRotation to a string (q0,q1,q2,q3) - /*! \param value - */ - const string SbRotationToString(SbRotation value) - { - //float q0,q1,q2,q3; - //value.getValue(q0,q1,q2,q3); + //! Converts a SbRotation to a string (q0,q1,q2,q3) + /*! \param value + */ + const string SbRotationToString(SbRotation value) + { + //float q0,q1,q2,q3; + //value.getValue(q0,q1,q2,q3); - //changed on 2006-12-15 + //changed on 2006-12-15 - SbVec3f axis; - float x,y,z,radians; + SbVec3f axis; + float x,y,z,radians; - value.getValue(axis,radians); - axis.getValue(x,y,z); - return DoubleToString(x)+" "+DoubleToString(y)+" "+DoubleToString(z)+" "+DoubleToString(radians); - } + value.getValue(axis,radians); + axis.getValue(x,y,z); + return DoubleToString(x)+" "+DoubleToString(y)+" "+DoubleToString(z)+" "+DoubleToString(radians); + } - //! Converts an string to its UPPERCASE - /*! \param value - * \return string - */ - const string toUp(string value) - { - //change each element of the string to upper case - for(unsigned int i=0;i<value.length();i++) - { - value[i] = toupper(value[i]); - } - return value;//return the converted string - } + //! Converts an string to its UPPERCASE + /*! \param value + * \return string + */ + const string toUp(string value) + { + //change each element of the string to upper case + for(unsigned int i=0;i<value.length();i++) + { + value[i] = toupper(value[i]); + } + return value;//return the converted string + } - const double maxDiff(const SbVec3f value1, const SbVec3f value2) - { - double diff1 = fabs(double(value1[0])-double(value2[0])); - double diff2 = fabs(double(value1[1])-double(value2[1])); - double diff3 = fabs(double(value1[2])-double(value2[2])); + const double maxDiff(const SbVec3f value1, const SbVec3f value2) + { + double diff1 = fabs(double(value1[0])-double(value2[0])); + double diff2 = fabs(double(value1[1])-double(value2[1])); + double diff3 = fabs(double(value1[2])-double(value2[2])); - return max(diff1,max(diff2,diff3)); - } + return max(diff1,max(diff2,diff3)); + } - const double maxDiff(const SbVec4f value1, const SbVec4f value2) - { - double diff1 = fabs(double(value1[0])-double(value2[0])); - double diff2 = fabs(double(value1[1])-double(value2[1])); - double diff3 = fabs(double(value1[2])-double(value2[2])); - double diff4 = fabs(double(value1[3])-double(value2[3])); + const double maxDiff(const SbVec4f value1, const SbVec4f value2) + { + double diff1 = fabs(double(value1[0])-double(value2[0])); + double diff2 = fabs(double(value1[1])-double(value2[1])); + double diff3 = fabs(double(value1[2])-double(value2[2])); + double diff4 = fabs(double(value1[3])-double(value2[3])); - return max(max(diff1,diff2),max(diff3,diff4)); - } + return max(max(diff1,diff2),max(diff3,diff4)); + } - const bool fileExists(const char* fileName) - { - ifstream theFile(fileName); - if (theFile) return true; - return false; - } + const bool fileExists(const char* fileName) + { + ifstream theFile(fileName); + if (theFile) return true; + return false; + } - const string leadingZero(int number, int totalLength) - { - string s = IntToString(number); - for (int i=s.length(); i<totalLength; i++) - { - s = "0" + s; - } + const string leadingZero(int number, int totalLength) + { + string s = IntToString(number); + for (int i=s.length(); i<totalLength; i++) + { + s = "0" + s; + } - return s; - } + return s; + } @@ -421,73 +425,73 @@ - // Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. Pure - // red always maps to 6 in this implementation. Therefore UNDEFINED can be - // defined as 0 in situations where only unsigned numbers are desired. - // http://jgt.akpeters.com/papers/SmithLyons96/hsv_rgb.html -#define RETURN_HSV(h, s, v) {HSV[0] = h; HSV[1] = s; HSV[2] = v; return HSV;} -#define RETURN_RGB(r, g, b) {RGB[0] = r; RGB[1] = g; RGB[2] = b; return RGB;} -#define UNDEFINED 0 + // Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. Pure + // red always maps to 6 in this implementation. Therefore UNDEFINED can be + // defined as 0 in situations where only unsigned numbers are desired. + // http://jgt.akpeters.com/papers/SmithLyons96/hsv_rgb.html +#define RETURN_HSV(h, s, v) {HSV[0] = h; HSV[1] = s; HSV[2] = v; return HSV;} +#define RETURN_RGB(r, g, b) {RGB[0] = r; RGB[1] = g; RGB[2] = b; return RGB;} +#define UNDEFINED 0 - /*const SbVec3f RGB_to_HSV( SbVec3f RGB ) - { + /*const SbVec3f RGB_to_HSV( SbVec3f RGB ) + { - // RGB are each on [0, 1]. S and V are returned on [0, 1] and H is - // returned on [0, 6]. Exception: H is returned UNDEFINED if S==0. - float R = RGB[0], G = RGB[1], B = RGB[2], v, x, f; - int i; - SbVec3f HSV; + // RGB are each on [0, 1]. S and V are returned on [0, 1] and H is + // returned on [0, 6]. Exception: H is returned UNDEFINED if S==0. + float R = RGB[0], G = RGB[1], B = RGB[2], v, x, f; + int i; + SbVec3f HSV; - x = min(R, max(G, B)); - v = max(R, max(G, B)); - if(v == x) - { - //RETURN_HSV(UNDEFINED, 0, v); - HSV[0] = 0; - HSV[1] = 0; - HSV[2] = v; - return HSV; - } - f = (R == x) ? G - B : ((G == x) ? B - R : R - G); - i = (R == x) ? 3 : ((G == x) ? 5 : 1); - //RETURN_HSV(i - f /(v - x), (v - x)/v, v); - HSV[0] = i - f /(v - x); - HSV[1] = (v - x)/v; - HSV[2] = v; - return HSV; - } + x = min(R, max(G, B)); + v = max(R, max(G, B)); + if(v == x) + { + //RETURN_HSV(UNDEFINED, 0, v); + HSV[0] = 0; + HSV[1] = 0; + HSV[2] = v; + return HSV; + } + f = (R == x) ? G - B : ((G == x) ? B - R : R - G); + i = (R == x) ? 3 : ((G == x) ? 5 : 1); + //RETURN_HSV(i - f /(v - x), (v - x)/v, v); + HSV[0] = i - f /(v - x); + HSV[1] = (v - x)/v; + HSV[2] = v; + return HSV; + } - SbVec3f HSV_to_RGB( SbVec3f HSV ) - { + SbVec3f HSV_to_RGB( SbVec3f HSV ) + { - // H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1]. - // RGB are each returned on [0, 1]. - float h = HSV[0], s = HSV[1], v = HSV[2], m, n, f; - int i; - SbVec3f RGB; + // H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1]. + // RGB are each returned on [0, 1]. + float h = HSV[0], s = HSV[1], v = HSV[2], m, n, f; + int i; + SbVec3f RGB; - if(h == UNDEFINED) - { - RETURN_RGB(v, v, v); - } - i = floor(h); - f = h - i; - if(!(i & 1)) f = 1 - f; // if i is even - m = v * (1 - s); - n = v * (1 - s * f); - switch (i) - { - case 6: - case 0: RETURN_RGB(v, n, m); - case 1: RETURN_RGB(n, v, m); - case 2: RETURN_RGB(m, v, n) - case 3: RETURN_RGB(m, n, v); - case 4: RETURN_RGB(n, m, v); - case 5: RETURN_RGB(v, m, n); - } - RETURN_RGB(v, v, v); - } */ + if(h == UNDEFINED) + { + RETURN_RGB(v, v, v); + } + i = floor(h); + f = h - i; + if(!(i & 1)) f = 1 - f; // if i is even + m = v * (1 - s); + n = v * (1 - s * f); + switch (i) + { + case 6: + case 0: RETURN_RGB(v, n, m); + case 1: RETURN_RGB(n, v, m); + case 2: RETURN_RGB(m, v, n) + case 3: RETURN_RGB(m, n, v); + case 4: RETURN_RGB(n, m, v); + case 5: RETURN_RGB(v, m, n); + } + RETURN_RGB(v, v, v); + } */ @@ -495,462 +499,470 @@ - // http://www.cs.rit.edu/~ncs/color/t_convert.html + // http://www.cs.rit.edu/~ncs/color/t_convert.html - // r,g,b values are from 0 to 1 - // h = [0,360], s = [0,1], v = [0,1] - // if s == 0, then h = -1 (undefined) - const SbVec3f RGB_to_HSV( SbVec3f RGB ) - { - float min_f, max_f, delta, h , s , v; - SbVec3f HSV; - min_f = min( RGB[0], min(RGB[1], RGB[2] ) ); - max_f = max( RGB[0], max(RGB[1], RGB[2] ) ); - v = max_f; // v - delta = max_f - min_f; - //if( max != 0 ) - if( delta != 0 ) - s = delta / max_f; // s - else { - // r = g = b = 0 // s = 0, v is undefined - s = 0; - //*h = -1; - h = 0; - //return; - RETURN_HSV(h,s,v); - } - if( RGB[0] == max_f ) - h = ( RGB[1] - RGB[2] ) / delta; // between yellow & magenta - else if( RGB[1] == max_f ) - h = 2 + ( RGB[2] - RGB[0] ) / delta; // between cyan & yellow - else - h = 4 + ( RGB[0] - RGB[1] ) / delta; // between magenta & cyan - h *= 60; // degrees - if( h < 0 ) - h += 360; + // r,g,b values are from 0 to 1 + // h = [0,360], s = [0,1], v = [0,1] + // if s == 0, then h = -1 (undefined) + const SbVec3f RGB_to_HSV( SbVec3f RGB ) + { + float min_f, max_f, delta, h , s , v; + SbVec3f HSV; + min_f = min( RGB[0], min(RGB[1], RGB[2] ) ); + max_f = max( RGB[0], max(RGB[1], RGB[2] ) ); + v = max_f; // v + delta = max_f - min_f; + //if( max != 0 ) + if( delta != 0 ) + s = delta / max_f; // s + else { + // r = g = b = 0 // s = 0, v is undefined + s = 0; + //*h = -1; + h = 0; + //return; + RETURN_HSV(h,s,v); + } + if( RGB[0] == max_f ) + h = ( RGB[1] - RGB[2] ) / delta; // between yellow & magenta + else if( RGB[1] == max_f ) + h = 2 + ( RGB[2] - RGB[0] ) / delta; // between cyan & yellow + else + h = 4 + ( RGB[0] - RGB[1] ) / delta; // between magenta & cyan + h *= 60; // degrees + if( h < 0 ) + h += 360; - RETURN_HSV(h,s,v); - } + RETURN_HSV(h,s,v); + } - SbVec3f HSV_to_RGB( SbVec3f HSV ) - { - SbVec3f RGB; - float r,g,b; - int i; - float f, p, q, t; - if( HSV[1] == 0 ) { - // achromatic (grey) - r = g = b = HSV[2]; - RETURN_RGB(r,g,b); - } - HSV[0] /= 60; // sector 0 to 5 - i = floor( HSV[0] ); - f = HSV[0] - i; // factorial part of h - p = HSV[2] * ( 1 - HSV[1] ); - q = HSV[2] * ( 1 - HSV[1] * f ); - t = HSV[2] * ( 1 - HSV[1] * ( 1 - f ) ); - switch( i ) { - case 0: - r = HSV[2]; - g = t; - b = p; - break; - case 1: - r = q; - g = HSV[2]; - b = p; - break; - case 2: - r = p; - g = HSV[2]; - b = t; - break; - case 3: - r = p; - g = q; - b = HSV[2]; - break; - case 4: - r = t; - g = p; - b = HSV[2]; - break; - default: // case 5: - r = HSV[2]; - g = p; - b = q; - break; - } + SbVec3f HSV_to_RGB( SbVec3f HSV ) + { + SbVec3f RGB; + float r,g,b; + int i; + float f, p, q, t; + if( HSV[1] == 0 ) { + // achromatic (grey) + r = g = b = HSV[2]; + RETURN_RGB(r,g,b); + } + HSV[0] /= 60; // sector 0 to 5 + i = floor( HSV[0] ); + f = HSV[0] - i; // factorial part of h + p = HSV[2] * ( 1 - HSV[1] ); + q = HSV[2] * ( 1 - HSV[1] * f ); + t = HSV[2] * ( 1 - HSV[1] * ( 1 - f ) ); + switch( i ) { + case 0: + r = HSV[2]; + g = t; + b = p; + break; + case 1: + r = q; + g = HSV[2]; + b = p; + break; + case 2: + r = p; + g = HSV[2]; + b = t; + break; + case 3: + r = p; + g = q; + b = HSV[2]; + break; + case 4: + r = t; + g = p; + b = HSV[2]; + break; + default: // case 5: + r = HSV[2]; + g = p; + b = q; + break; + } - RETURN_RGB(r,g,b); - } + RETURN_RGB(r,g,b); + } - template <typename T> - const int Signum(T value) - { - return (value > 0) - (value < 0); - } + template <typename T> + const int Signum(T value) + { + return (value > 0) - (value < 0); + } - const int round(float value) - { - return floor(value +0.5); - } + const int round(float value) + { + return floor(value +0.5); + } - void DebugTest(string debugStr, short /*level*/) - { - std::cout << debugStr << std::endl; - } + void DebugTest(string debugStr, short /*level*/) + { + std::cout << debugStr << std::endl; + } - void initRand() - { - time_t sek; - time(&sek); - srand((unsigned)sek); - } + void initRand() + { + time_t sek; + time(&sek); + srand((unsigned)sek); + } - /* get integer random number in range a <= x <= e */ - int random( int a, int e) - { - double r = e - a + 1; - return a + (int)(r * rand()/(RAND_MAX+1.0)); - } + /* get integer random number in range a <= x <= e */ + int random( int a, int e) + { + double r = e - a + 1; + return a + (int)(r * rand()/(RAND_MAX+1.0)); + } - //QUICK-SORT Implementierung nack Wiki + //QUICK-SORT Implementierung nack Wiki - void qs_swap(double* values, int a, int b) - { - double temp = values[a]; - values[a] = values[b]; - values[b] = temp; - } + void qs_swap(double* values, int a, int b) + { + double temp = values[a]; + values[a] = values[b]; + values[b] = temp; + } - int qs_divide(double* values, int start, int end) - { - int index = start; - for (int i=start; i<end; i++) - { - if (values[i]<=values[end]) - { - qs_swap(values, index, i); - index++; - } - } - qs_swap(values, index,end); - return index; - } + int qs_divide(double* values, int start, int end) + { + int index = start; + for (int i=start; i<end; i++) + { + if (values[i]<=values[end]) + { + qs_swap(values, index, i); + index++; + } + } + qs_swap(values, index,end); + return index; + } - void quickSort(double* values, int start, int end) - { - int pivot; - if (end>start) - { - pivot = qs_divide(values, start, end); - quickSort(values, start, pivot-1); - quickSort(values, pivot+1, end); - } - } + void quickSort(double* values, int start, int end) + { + int pivot; + if (end>start) + { + pivot = qs_divide(values, start, end); + quickSort(values, start, pivot-1); + quickSort(values, pivot+1, end); + } + } - /** Ermittelt die aktuelle Zeit in ms(?) - \return double - */ - double getCurrentTime() - { - long long Frequency, LastTime; - double TimeScale; - QueryPerformanceFrequency( (LARGE_INTEGER*) &Frequency); - TimeScale = 1.0/Frequency; - QueryPerformanceCounter( (LARGE_INTEGER*) &LastTime); - return LastTime * TimeScale; - } + /** Ermittelt die aktuelle Zeit in ms(?) + \return double + */ +#ifdef WIN32 + double getCurrentTime() + { + long long Frequency=0; + QueryPerformanceFrequency( (LARGE_INTEGER*) &Frequency); + const double TimeScale = 1.0/Frequency; + long long LastTime=0; + QueryPerformanceCounter( (LARGE_INTEGER*) &LastTime); + return LastTime * TimeScale; + } +#else + double getCurrentTime() + { + ML_NAMESPACE::TimeCounter tc; + return tc.getCurrentValueInSeconds(); + } +#endif - char getOptions(vector<string>& in,const list<optionstruct>& options,string& value){ - if(in.size()>1){ - if(in[0].size()==2 && in[0][0]=='-'){ - list<optionstruct>::const_iterator it=options.begin(); - while(it!=options.end()){ - if(it->shortname==in[0][1]){ - in.erase(in.begin()); - value=""; - while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ - value+=" "+in[0]; - in.erase(in.begin()); - } - value=trimString(value); - return it->shortname; - } - it++; - } - in.erase(in.begin()); - while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ - in.erase(in.begin()); - } - return 0; - }else if(in[0].size()>2 && in[0][0]=='-' && in[0][1]=='-'){ - list<optionstruct>::const_iterator it=options.begin(); - while(it!=options.end()){ - if(it->name==in[0].substr(2)){ - in.erase(in.begin()); - value=""; - while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ - value+=" "+in[0]; - in.erase(in.begin()); - } - value=trimString(value); - return it->shortname; - } - it++; - } - in.erase(in.begin()); - while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ - in.erase(in.begin()); - } - return 0; - } - } - return -1; - } + char getOptions(vector<string>& in,const list<optionstruct>& options,string& value){ + if(in.size()>1){ + if(in[0].size()==2 && in[0][0]=='-'){ + list<optionstruct>::const_iterator it=options.begin(); + while(it!=options.end()){ + if(it->shortname==in[0][1]){ + in.erase(in.begin()); + value=""; + while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ + value+=" "+in[0]; + in.erase(in.begin()); + } + value=trimString(value); + return it->shortname; + } + it++; + } + in.erase(in.begin()); + while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ + in.erase(in.begin()); + } + return 0; + }else if(in[0].size()>2 && in[0][0]=='-' && in[0][1]=='-'){ + list<optionstruct>::const_iterator it=options.begin(); + while(it!=options.end()){ + if(it->name==in[0].substr(2)){ + in.erase(in.begin()); + value=""; + while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ + value+=" "+in[0]; + in.erase(in.begin()); + } + value=trimString(value); + return it->shortname; + } + it++; + } + in.erase(in.begin()); + while(in.size()>0 && in[0].size()>0 && in[0][0]!='-'){ + in.erase(in.begin()); + } + return 0; + } + } + return -1; + } - bool lineIntersection(POINT p1, POINT p2, POINT p3, POINT p4, POINT &intersectionPoint) - { - float denominator; - float numerator1, numerator2; + bool lineIntersection(POINT p1, POINT p2, POINT p3, POINT p4, POINT &intersectionPoint) + { + float denominator; + float numerator1, numerator2; - //If the intersection of line segments is required then it is only necessary to test if ua and ub lie between 0 and 1. - //Whichever one lies within that range then the corresponding line segment contains the intersection point. - //-->If both lie within the range of 0 to 1 then the intersection point is within both line segments. + //If the intersection of line segments is required then it is only necessary to test if ua and ub lie between 0 and 1. + //Whichever one lies within that range then the corresponding line segment contains the intersection point. + //-->If both lie within the range of 0 to 1 then the intersection point is within both line segments. - denominator = (p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y); - numerator1 = (p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x); - numerator2 = (p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x); + denominator = (p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y); + numerator1 = (p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x); + numerator2 = (p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x); - if (denominator!=0) - { - float ua,ub; - ua = numerator1/denominator; - ub = numerator2/denominator; - if (ua>0 && ua<1 && ub>0 && ub<1) - { - //Intersection Point - intersectionPoint.x = p1.x + ua*(p2.x-p1.x); - intersectionPoint.y = p1.y + ua*(p2.y-p1.y); - return true; - } - else return false; - } - else return false; + if (denominator!=0) + { + float ua,ub; + ua = numerator1/denominator; + ub = numerator2/denominator; + if (ua>0 && ua<1 && ub>0 && ub<1) + { + //Intersection Point + intersectionPoint.x = p1.x + ua*(p2.x-p1.x); + intersectionPoint.y = p1.y + ua*(p2.y-p1.y); + return true; + } + else return false; + } + else return false; - //return false; - } + //return false; + } - bool boxIntersection(POINT r1_corner1, POINT r1_corner2, POINT r2_corner1, POINT r2_corner2, BOX &intersectionBox) - { - bool intersect; - //Check for real intersection - if ( r2_corner1.x>=r1_corner2.x - || r2_corner2.x<=r1_corner1.x - || r2_corner1.y>=r1_corner2.y - || r2_corner2.y<=r1_corner1.y) - { - intersect = false; - } - else - { - intersect = true; - //Calc intersection box - POINT intersectionPoint; - bool lineintersect; + bool boxIntersection(POINT r1_corner1, POINT r1_corner2, POINT r2_corner1, POINT r2_corner2, BOX &intersectionBox) + { + bool intersect; + //Check for real intersection + if ( r2_corner1.x>=r1_corner2.x + || r2_corner2.x<=r1_corner1.x + || r2_corner1.y>=r1_corner2.y + || r2_corner2.y<=r1_corner1.y) + { + intersect = false; + } + else + { + intersect = true; + //Calc intersection box + POINT intersectionPoint; + bool lineintersect; - //Corner 1 and 4 for the left side of the box - if (r1_corner1.x>=r2_corner1.x) - { - lineintersect=lineIntersection(r1_corner1,POINT(r1_corner1.x,r1_corner2.y), - r2_corner1,POINT(r2_corner2.x,r2_corner1.y),intersectionPoint); - if (lineintersect) - { - intersectionBox.corner1=intersectionPoint; - } - else - { - intersectionBox.corner1.x=r1_corner1.x; - intersectionBox.corner1.y=r1_corner1.y; - } + //Corner 1 and 4 for the left side of the box + if (r1_corner1.x>=r2_corner1.x) + { + lineintersect=lineIntersection(r1_corner1,POINT(r1_corner1.x,r1_corner2.y), + r2_corner1,POINT(r2_corner2.x,r2_corner1.y),intersectionPoint); + if (lineintersect) + { + intersectionBox.corner1=intersectionPoint; + } + else + { + intersectionBox.corner1.x=r1_corner1.x; + intersectionBox.corner1.y=r1_corner1.y; + } - lineintersect=lineIntersection(r1_corner1,POINT(r1_corner1.x,r1_corner2.y), - POINT(r2_corner1.x,r2_corner2.y),r2_corner2,intersectionPoint); - if (lineintersect) - { - intersectionBox.corner4=intersectionPoint; - } - else - { - intersectionBox.corner4.x=r1_corner1.x; - intersectionBox.corner4.y=r1_corner2.y; - } - } - else - { - lineintersect=lineIntersection(r2_corner1,POINT(r2_corner1.x,r2_corner2.y), - r1_corner1,POINT(r1_corner2.x,r1_corner1.y),intersectionPoint); - if (lineintersect) - { - intersectionBox.corner1=intersectionPoint; - } - else - { - intersectionBox.corner1.x=r2_corner1.x; - intersectionBox.corner1.y=r2_corner1.y; - } + lineintersect=lineIntersection(r1_corner1,POINT(r1_corner1.x,r1_corner2.y), + POINT(r2_corner1.x,r2_corner2.y),r2_corner2,intersectionPoint); + if (lineintersect) + { + intersectionBox.corner4=intersectionPoint; + } + else + { + intersectionBox.corner4.x=r1_corner1.x; + intersectionBox.corner4.y=r1_corner2.y; + } + } + else + { + lineintersect=lineIntersection(r2_corner1,POINT(r2_corner1.x,r2_corner2.y), + r1_corner1,POINT(r1_corner2.x,r1_corner1.y),intersectionPoint); + if (lineintersect) + { + intersectionBox.corner1=intersectionPoint; + } + else + { + intersectionBox.corner1.x=r2_corner1.x; + intersectionBox.corner1.y=r2_corner1.y; + } - lineintersect=lineIntersection(r2_corner1,POINT(r2_corner1.x,r2_corner2.y), - POINT(r1_corner1.x,r1_corner2.y),r1_corner2,intersectionPoint); - if (lineintersect) - { - intersectionBox.corner4=intersectionPoint; - } - else - { - intersectionBox.corner4.x=r2_corner1.x; - intersectionBox.corner4.y=r2_corner2.y; - } - } + lineintersect=lineIntersection(r2_corner1,POINT(r2_corner1.x,r2_corner2.y), + POINT(r1_corner1.x,r1_corner2.y),r1_corner2,intersectionPoint); + if (lineintersect) + { + intersectionBox.corner4=intersectionPoint; + } + else + { + intersectionBox.corner4.x=r2_corner1.x; + intersectionBox.corner4.y=r2_corner2.y; + } + } - //Corner 2 and 3 for the right side of the box - if (r1_corner2.x<=r2_corner2.x) - { - lineintersect=lineIntersection(POINT(r1_corner2.x,r1_corner1.y),r1_corner2, - r2_corner1,POINT(r2_corner2.x,r2_corner1.y),intersectionPoint); - if (lineintersect) - { - intersectionBox.corner2=intersectionPoint; - } - else - { - intersectionBox.corner2.x=r1_corner2.x; - intersectionBox.corner2.y=r1_corner1.y; - } + //Corner 2 and 3 for the right side of the box + if (r1_corner2.x<=r2_corner2.x) + { + lineintersect=lineIntersection(POINT(r1_corner2.x,r1_corner1.y),r1_corner2, + r2_corner1,POINT(r2_corner2.x,r2_corner1.y),intersectionPoint); + if (lineintersect) + { + intersectionBox.corner2=intersectionPoint; + } + else + { + intersectionBox.corner2.x=r1_corner2.x; + intersectionBox.corner2.y=r1_corner1.y; + } - lineintersect=lineIntersection(POINT(r1_corner2.x,r1_corner1.y),r1_corner2, - POINT(r2_corner1.x,r2_corner2.y),r2_corner2,intersectionPoint); - if (lineintersect) - { - intersectionBox.corner3=intersectionPoint; - } - else - { - intersectionBox.corner3.x=r1_corner2.x; - intersectionBox.corner3.y=r1_corner2.y; - } - } - else - { - lineintersect=lineIntersection(POINT(r2_corner2.x,r2_corner1.y),r2_corner2, - r1_corner1,POINT(r1_corner2.x,r1_corner1.y),intersectionPoint); - if (lineintersect) - { - intersectionBox.corner2=intersectionPoint; - } - else - { - intersectionBox.corner2.x=r2_corner2.x; - intersectionBox.corner2.y=r2_corner1.y; - } + lineintersect=lineIntersection(POINT(r1_corner2.x,r1_corner1.y),r1_corner2, + POINT(r2_corner1.x,r2_corner2.y),r2_corner2,intersectionPoint); + if (lineintersect) + { + intersectionBox.corner3=intersectionPoint; + } + else + { + intersectionBox.corner3.x=r1_corner2.x; + intersectionBox.corner3.y=r1_corner2.y; + } + } + else + { + lineintersect=lineIntersection(POINT(r2_corner2.x,r2_corner1.y),r2_corner2, + r1_corner1,POINT(r1_corner2.x,r1_corner1.y),intersectionPoint); + if (lineintersect) + { + intersectionBox.corner2=intersectionPoint; + } + else + { + intersectionBox.corner2.x=r2_corner2.x; + intersectionBox.corner2.y=r2_corner1.y; + } - lineintersect=lineIntersection(POINT(r2_corner2.x,r2_corner1.y),r2_corner2, - POINT(r1_corner1.x,r1_corner2.y),r1_corner2,intersectionPoint); - if (lineintersect) - { - intersectionBox.corner3=intersectionPoint; - } - else - { - intersectionBox.corner3.x=r2_corner2.x; - intersectionBox.corner3.y=r2_corner2.y; - } - } - } + lineintersect=lineIntersection(POINT(r2_corner2.x,r2_corner1.y),r2_corner2, + POINT(r1_corner1.x,r1_corner2.y),r1_corner2,intersectionPoint); + if (lineintersect) + { + intersectionBox.corner3=intersectionPoint; + } + else + { + intersectionBox.corner3.x=r2_corner2.x; + intersectionBox.corner3.y=r2_corner2.y; + } + } + } - //Check for inclusion - if (!intersect) - { - if (r1_corner1.x>=r2_corner1.x - && r1_corner1.y>=r2_corner1.y - && r1_corner2.x<=r2_corner2.x - && r1_corner2.y<=r2_corner2.y) - { - intersect=true; - intersectionBox.corner1.x = r1_corner1.x; - intersectionBox.corner1.y = r1_corner1.y; - intersectionBox.corner2.x = r1_corner2.x; - intersectionBox.corner2.y = r1_corner1.y; - intersectionBox.corner3.x = r1_corner2.x; - intersectionBox.corner3.y = r1_corner2.y; - intersectionBox.corner4.x = r1_corner1.x; - intersectionBox.corner4.y = r1_corner2.y; - } - else if (r2_corner1.x>=r1_corner1.x - && r2_corner1.y>=r1_corner1.y - && r2_corner2.x<=r1_corner2.x - && r2_corner2.y<=r1_corner2.y) - { - intersect=true; - intersectionBox.corner1.x = r2_corner1.x; - intersectionBox.corner1.y = r2_corner1.y; - intersectionBox.corner2.x = r2_corner2.x; - intersectionBox.corner2.y = r2_corner1.y; - intersectionBox.corner3.x = r2_corner2.x; - intersectionBox.corner3.y = r2_corner2.y; - intersectionBox.corner4.x = r2_corner1.x; - intersectionBox.corner4.y = r2_corner2.y; - } - } + //Check for inclusion + if (!intersect) + { + if (r1_corner1.x>=r2_corner1.x + && r1_corner1.y>=r2_corner1.y + && r1_corner2.x<=r2_corner2.x + && r1_corner2.y<=r2_corner2.y) + { + intersect=true; + intersectionBox.corner1.x = r1_corner1.x; + intersectionBox.corner1.y = r1_corner1.y; + intersectionBox.corner2.x = r1_corner2.x; + intersectionBox.corner2.y = r1_corner1.y; + intersectionBox.corner3.x = r1_corner2.x; + intersectionBox.corner3.y = r1_corner2.y; + intersectionBox.corner4.x = r1_corner1.x; + intersectionBox.corner4.y = r1_corner2.y; + } + else if (r2_corner1.x>=r1_corner1.x + && r2_corner1.y>=r1_corner1.y + && r2_corner2.x<=r1_corner2.x + && r2_corner2.y<=r1_corner2.y) + { + intersect=true; + intersectionBox.corner1.x = r2_corner1.x; + intersectionBox.corner1.y = r2_corner1.y; + intersectionBox.corner2.x = r2_corner2.x; + intersectionBox.corner2.y = r2_corner1.y; + intersectionBox.corner3.x = r2_corner2.x; + intersectionBox.corner3.y = r2_corner2.y; + intersectionBox.corner4.x = r2_corner1.x; + intersectionBox.corner4.y = r2_corner2.y; + } + } - return intersect; - } + return intersect; + } - bool pointInBox(POINTF p1, POINT corner1, POINT corner2) - { - bool isInBox; - isInBox=false; + bool pointInBox(POINTF p1, POINT corner1, POINT corner2) + { + bool isInBox; + isInBox=false; - if (p1.x>=corner1.x && p1.x<=corner2.x && - p1.y>=corner1.y && p1.y<=corner2.y) - { - isInBox=true; - } + if (p1.x>=corner1.x && p1.x<=corner2.x && + p1.y>=corner1.y && p1.y<=corner2.y) + { + isInBox=true; + } - return isInBox; - } + return isInBox; + } - long hex2int(const string& hexStr) - { - char *offset; - if (hexStr.length( ) > 2) - { - if (hexStr[0] == '0' && hexStr[1] == 'x') - { - return strtol(hexStr.c_str( ), &offset, 0); - } - else - { - std::cout << "hex must start with 0x"; - return 0; - } - } - return 0; - } + long hex2int(const string& hexStr) + { + char *offset; + if (hexStr.length( ) > 2) + { + if (hexStr[0] == '0' && hexStr[1] == 'x') + { + return strtol(hexStr.c_str( ), &offset, 0); + } + else + { + std::cout << "hex must start with 0x"; + return 0; + } + } + return 0; + } -} //namespace kBasics \ No newline at end of file +} //namespace kBasics This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-21 15:56:06
|
Revision: 87 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=87&view=rev Author: wolfspindler Date: 2009-06-21 15:56:03 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Include of windows.h suppressed on non windows platforms Modified Paths: -------------- trunk/Community/METK/Sources/common/StdAfx.h Modified: trunk/Community/METK/Sources/common/StdAfx.h =================================================================== --- trunk/Community/METK/Sources/common/StdAfx.h 2009-06-21 15:55:05 UTC (rev 86) +++ trunk/Community/METK/Sources/common/StdAfx.h 2009-06-21 15:56:03 UTC (rev 87) @@ -12,9 +12,11 @@ // F\xFCgen Sie hier Ihre Header-Dateien ein -#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden +#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden -#include <windows.h> +#ifdef WIN32 + #include <windows.h> +#endif // ZU ERLEDIGEN: Verweisen Sie hier auf zus\xE4tzliche Header-Dateien, die Ihr Programm ben\xF6tigt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-21 15:55:13
|
Revision: 86 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=86&view=rev Author: wolfspindler Date: 2009-06-21 15:55:05 +0000 (Sun, 21 Jun 2009) Log Message: ----------- BUG: -Platform dependent extra class qualification in header removed. -Doxygen comments activated Modified Paths: -------------- trunk/Community/METK/Sources/common/XMLParser.h Modified: trunk/Community/METK/Sources/common/XMLParser.h =================================================================== --- trunk/Community/METK/Sources/common/XMLParser.h 2009-06-18 06:29:21 UTC (rev 85) +++ trunk/Community/METK/Sources/common/XMLParser.h 2009-06-21 15:55:05 UTC (rev 86) @@ -1,4 +1,5 @@ -//XMLParser.h +//! An XMLParser class based on Xerces. +//! file XMLParser.h #ifndef _XMLParser_ #define _XMLParser_ @@ -8,7 +9,7 @@ #ifndef common_EXPORTS #define __COMMON_IMPORTEXPORT __declspec(dllimport) #else -#define __COMMON_IMPORTEXPORT __declspec(dllexport) +#define __COMMON_IMPORTEXPORT __declspec(dllexport) #endif #else #define __COMMON_IMPORTEXPORT @@ -39,45 +40,46 @@ XERCES_CPP_NAMESPACE_USE -// Simple error handler deriviative to install on parser +//! Simple error handler deriviative to install on parser class __COMMON_IMPORTEXPORT XMLParserErrorHandler : public DOMErrorHandler { public: - XMLParserErrorHandler(); - ~XMLParserErrorHandler(); - - bool getSawErrors() const; - bool handleError(const DOMError& domError); - void resetErrors(); - + XMLParserErrorHandler(); + ~XMLParserErrorHandler(); + + bool getSawErrors() const; + bool handleError(const DOMError& domError); + void resetErrors(); + private : - XMLParserErrorHandler(const XMLParserErrorHandler&); - void operator=(const XMLParserErrorHandler&); - bool fSawErrors; //This is set if we get any errors + XMLParserErrorHandler(const XMLParserErrorHandler&); + void operator=(const XMLParserErrorHandler&); + bool fSawErrors; //This is set if we get any errors }; +//! An XMLParser class based on Xerces. class __COMMON_IMPORTEXPORT XMLParser { private: - DOMImplementation *impl; - DOMBuilder *parser; - XERCES_CPP_NAMESPACE::DOMDocument* xml_doc; - DOMNode* rootNode; + DOMImplementation *impl; + DOMBuilder *parser; + XERCES_CPP_NAMESPACE::DOMDocument* xml_doc; + DOMNode* rootNode; public: - XMLParser() { } - ~XMLParser(); + XMLParser() { } + ~XMLParser(); - DOMNode* getRootNode() { return rootNode; } + DOMNode* getRootNode() { return rootNode; } - int parseXMLFile(const char*); - int parseXMLString(const std::string* xmlString); - - int XMLParser::countChildElements(DOMNode *n); + int parseXMLFile(const char*); + int parseXMLString(const std::string* xmlString); + + int countChildElements(DOMNode *n); }; -#endif // _XMLParser_ \ No newline at end of file +#endif // _XMLParser_ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-18 06:29:22
|
Revision: 85 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=85&view=rev Author: konrad79 Date: 2009-06-18 06:29:21 +0000 (Thu, 18 Jun 2009) Log Message: ----------- METK: rename something for linux Modified Paths: -------------- trunk/Community/METK/Sources/common/StdAfx.cpp trunk/Community/METK/Sources/common/XMLParser.cpp Modified: trunk/Community/METK/Sources/common/StdAfx.cpp =================================================================== --- trunk/Community/METK/Sources/common/StdAfx.cpp 2009-06-17 09:03:30 UTC (rev 84) +++ trunk/Community/METK/Sources/common/StdAfx.cpp 2009-06-18 06:29:21 UTC (rev 85) @@ -2,7 +2,7 @@ // AnimationParserDLL.pch ist die vorkompilierte Header-Datei // stdafx.obj enth\xE4lt die vorkompilierte Typinformation -#include "stdafx.h" +#include "StdAfx.h" // ZU ERLEDIGEN: Verweis auf alle zus\xE4tzlichen Header-Dateien, die Sie in STDAFX.H // und nicht in dieser Datei ben\xF6tigen Modified: trunk/Community/METK/Sources/common/XMLParser.cpp =================================================================== --- trunk/Community/METK/Sources/common/XMLParser.cpp 2009-06-17 09:03:30 UTC (rev 84) +++ trunk/Community/METK/Sources/common/XMLParser.cpp 2009-06-18 06:29:21 UTC (rev 85) @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "StdAfx.h" #include "XMLParser.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-17 09:03:36
|
Revision: 84 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=84&view=rev Author: konrad79 Date: 2009-06-17 09:03:30 +0000 (Wed, 17 Jun 2009) Log Message: ----------- METK: add docu (pdf) Added Paths: ----------- trunk/Community/METK/Documentation/METKDocumentation.pdf Added: trunk/Community/METK/Documentation/METKDocumentation.pdf =================================================================== --- trunk/Community/METK/Documentation/METKDocumentation.pdf (rev 0) +++ trunk/Community/METK/Documentation/METKDocumentation.pdf 2009-06-17 09:03:30 UTC (rev 84) @@ -0,0 +1,43571 @@ +%PDF-1.7 +%\xE2\xE3\xCF\xD3 +1446 0 obj +<</Linearized 1/L 25057495/O 1449/E 12526/N 103/T 25028526/H [ 1036 1739]>> +endobj + +xref +1446 37 +0000000016 00000 n +0000002775 00000 n +0000002938 00000 n +0000002975 00000 n +0000003333 00000 n +0000003459 00000 n +0000003586 00000 n +0000003715 00000 n +0000003844 00000 n +0000003974 00000 n +0000004104 00000 n +0000004234 00000 n +0000004364 00000 n +0000004494 00000 n +0000004624 00000 n +0000004753 00000 n +0000004887 00000 n +0000005021 00000 n +0000005155 00000 n +0000005289 00000 n +0000005416 00000 n +0000005546 00000 n +0000005676 00000 n +0000005806 00000 n +0000005932 00000 n +0000006058 00000 n +0000006185 00000 n +0000006315 00000 n +0000006914 00000 n +0000007951 00000 n +0000007990 00000 n +0000008183 00000 n +0000008367 00000 n +0000008540 00000 n +0000008619 00000 n +0000009831 00000 n +0000001036 00000 n +trailer +<</Size 1483/Prev 25028513/Root 1447 0 R/Info 1445 0 R/ID[<446239EF4B9F78C63BE3EB292FC0FC18><3FAA95A1F368DC40AA0F602AAD576C39>]>> +startxref +0 +%%EOF + +1482 0 obj +<</Length 1631/E 3056/Filter/FlateDecode/I 3088/L 3072/O 3040/S 2922>>stream +x\xDA\xECVOSg\xFEΡ\x85*8{\xB0\x94\xCB\,,\x99\xCA0\x95\xC5\xCC +U4s\xEA:\x9CW\xCC\xD8\xC1\x82lS\xB9\xD8zt\xC8Z\x9Df\x9Am0\x90봀h\x99\x8AӜ\xC4XQX4\x93\x80[f\xE60(2S4*\x8BfF`s\xDF\xED\xB4Ÿ\xEC\x8C\xD0s\xBE\xCB\xFB=\xEF\xF3<\xEF{N |
From: <kon...@us...> - 2009-06-17 08:46:08
|
Revision: 83 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=83&view=rev Author: konrad79 Date: 2009-06-17 08:46:05 +0000 (Wed, 17 Jun 2009) Log Message: ----------- METK: common: change LONGLONG to long long for linux Modified Paths: -------------- trunk/Community/METK/Sources/common/kBasics.cpp Modified: trunk/Community/METK/Sources/common/kBasics.cpp =================================================================== --- trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-17 08:36:42 UTC (rev 82) +++ trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-17 08:46:05 UTC (rev 83) @@ -502,15 +502,15 @@ // if s == 0, then h = -1 (undefined) const SbVec3f RGB_to_HSV( SbVec3f RGB ) { - float min, max, delta, h , s , v; + float min_f, max_f, delta, h , s , v; SbVec3f HSV; - min = min( RGB[0], min(RGB[1], RGB[2] ) ); - max = max( RGB[0], max(RGB[1], RGB[2] ) ); - v = max; // v - delta = max - min; + min_f = min( RGB[0], min(RGB[1], RGB[2] ) ); + max_f = max( RGB[0], max(RGB[1], RGB[2] ) ); + v = max_f; // v + delta = max_f - min_f; //if( max != 0 ) if( delta != 0 ) - s = delta / max; // s + s = delta / max_f; // s else { // r = g = b = 0 // s = 0, v is undefined s = 0; @@ -519,9 +519,9 @@ //return; RETURN_HSV(h,s,v); } - if( RGB[0] == max ) + if( RGB[0] == max_f ) h = ( RGB[1] - RGB[2] ) / delta; // between yellow & magenta - else if( RGB[1] == max ) + else if( RGB[1] == max_f ) h = 2 + ( RGB[2] - RGB[0] ) / delta; // between cyan & yellow else h = 4 + ( RGB[0] - RGB[1] ) / delta; // between magenta & cyan @@ -663,7 +663,7 @@ */ double getCurrentTime() { - LONGLONG Frequency, LastTime; + long long Frequency, LastTime; double TimeScale; QueryPerformanceFrequency( (LARGE_INTEGER*) &Frequency); TimeScale = 1.0/Frequency; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kon...@us...> - 2009-06-17 08:36:55
|
Revision: 82 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=82&view=rev Author: konrad79 Date: 2009-06-17 08:36:42 +0000 (Wed, 17 Jun 2009) Log Message: ----------- METK: adapt some modules for MeVisLab 2.0 Modified Paths: -------------- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METK-Example.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCSO.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCaseObject.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKGUI/METKStructureGroupBrowser.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKLoadSegMask.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKInventorObject.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKManager.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/NeckVisionXMLConverter.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/IsoSurfaceContainer.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/METKIsoSurface.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKSafetyMargin.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStatus.mlab trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStructureDetails.mlab trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.cpp trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.h trunk/Community/METK/Sources/common/kBasics.cpp trunk/Community/METK/Sources/common/kBasics.h Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METK-Example.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METK-Example.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METK-Example.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -391,9 +391,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCSO.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCSO.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCSO.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -75,9 +75,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCaseObject.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCaseObject.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKCaseObject.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -30,9 +30,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKGUI/METKStructureGroupBrowser.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKGUI/METKStructureGroupBrowser.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKGUI/METKStructureGroupBrowser.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -5,6 +5,7 @@ module ObjConstrainedIterator { internal { frame = "537 301 160 56" + moduleGroupName = "" } fields { instanceName = ObjConstrainedIterator @@ -21,6 +22,7 @@ module ObjInfo { internal { frame = "581 393 72 64" + moduleGroupName = "" } fields { instanceName = info @@ -39,19 +41,16 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE doubleValue = 0 - vec3Value = "0.000000 0.000000 0.000000" - vec4Value = "0.000000 0.000000 0.000000 0.000000" - mat4Value = "1.000000 0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 -0.000000 0.000000 0.000000 1.000000" + vec3Value = "0 0 0" + vec4Value = "0 0 0 0" + mat4Value = "1 0 0 0 +0 1 0 0 +0 0 1 0 +0 0 0 1" genObjIDPrefix = "" genLayerIDPrefix = "" infoType = omAttribute_std_string @@ -70,3 +69,4 @@ connections { ObjConstrainedIterator.inObjectContainer = info.outObjectContainer } +networkModel = "" Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKLoadSegMask.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKLoadSegMask.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKLoadSegMask.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -119,9 +119,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKInventorObject.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKInventorObject.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKInventorObject.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -5,6 +5,7 @@ module SoGroup { internal { frame = "1353 557 96 56" + moduleGroupName = "" } fields { instanceName = SoGroup @@ -13,6 +14,7 @@ module SoLabel { internal { frame = "1257 713 80 64" + moduleGroupName = "" windows { window _default { geometry = "114 133 208 173" @@ -30,11 +32,12 @@ module ObjInfo { internal { frame = "1133 705 72 64" + moduleGroupName = "" windows { window _default { - geometry = "165 136 543 408" - sizeHint = "543 408" - wasOpen = yes + geometry = "165 136 499 408" + sizeHint = "499 408" + wasOpen = no wasActive = no } } @@ -56,9 +59,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE @@ -87,6 +87,7 @@ module LocalSoFile { internal { frame = "1361 713 96 64" + moduleGroupName = "" windows { window _default { geometry = "194 298 522 211" @@ -111,6 +112,7 @@ module UMDBoundingBoxCalculator2 { internal { frame = "1041 469 192 56" + moduleGroupName = "" windows { window _default { geometry = "92 111 334 192" @@ -132,6 +134,7 @@ module UMDInventorToPointer { internal { frame = "1297 229 160 56" + moduleGroupName = "" windows { window _default { geometry = "852 148 210 217" @@ -145,7 +148,7 @@ instanceName = UMDInventorToPointer priority = 10000 debugComment = "" - Pointer = 459882360 + Pointer = 0x15F7F9A0 objectID = "" layerID = "" infoID = "" @@ -158,3 +161,4 @@ UMDInventorToPointer.inObjectContainer = info.outObjectContainer UMDInventorToPointer.inInventor = SoGroup.self } +networkModel = "" Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKManager.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKManager.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/METKManager.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -246,9 +246,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE @@ -431,9 +428,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/NeckVisionXMLConverter.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/NeckVisionXMLConverter.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKOpen/NeckVisionXMLConverter.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -5,11 +5,13 @@ module ObjInfo { internal { frame = "885 297 72 64" + moduleGroupName = "" windows { window _default { geometry = "334 177 539 1016" sizeHint = "539 1016" wasOpen = no + wasActive = no } } } @@ -30,19 +32,16 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE doubleValue = 0 - vec3Value = "0.000000 0.000000 0.000000" - vec4Value = "0.000000 0.000000 0.000000 0.000000" - mat4Value = "1.000000 0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 -0.000000 0.000000 0.000000 1.000000" + vec3Value = "0 0 0" + vec4Value = "0 0 0 0" + mat4Value = "1 0 0 0 +0 1 0 0 +0 0 1 0 +0 0 0 1" genObjIDPrefix = "" genLayerIDPrefix = "" infoType = omAttribute_std_string @@ -61,11 +60,13 @@ module ObjInfo { internal { frame = "653 297 72 64" + moduleGroupName = "" windows { window _default { geometry = "26 45 539 1016" sizeHint = "539 1016" wasOpen = no + wasActive = no } } } @@ -86,19 +87,16 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE doubleValue = 0 - vec3Value = "0.000000 0.000000 0.000000" - vec4Value = "0.000000 0.000000 0.000000 0.000000" - mat4Value = "1.000000 0.000000 0.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 -0.000000 0.000000 1.000000 0.000000 -0.000000 0.000000 0.000000 1.000000" + vec3Value = "0 0 0" + vec4Value = "0 0 0 0" + mat4Value = "1 0 0 0 +0 1 0 0 +0 0 1 0 +0 0 0 1" genObjIDPrefix = "" genLayerIDPrefix = "" infoType = omAttribute_std_string @@ -115,3 +113,4 @@ } } connections = "" +networkModel = "" Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/IsoSurfaceContainer.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/IsoSurfaceContainer.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/IsoSurfaceContainer.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -5,6 +5,7 @@ module SoToggle { internal { frame = "941 297 88 64" + moduleGroupName = "" windows { window _default { geometry = "543 459 104 25" @@ -23,6 +24,7 @@ module SoSeparator { internal { frame = "933 401 104 64" + moduleGroupName = "" } fields { instanceName = 3DGroup @@ -35,6 +37,7 @@ module SoToggle { internal { frame = "941 225 88 64" + moduleGroupName = "" windows { window _default { geometry = "543 459 104 25" @@ -53,6 +56,7 @@ module UMDInventorToPointer { internal { frame = "745 161 160 64" + moduleGroupName = "" windows { window _default { geometry = "214 330 210 217" @@ -66,7 +70,7 @@ instanceName = IsoSurfacePointer priority = 10000 debugComment = "" - Pointer = 193485072 + Pointer = 0x15FA6328 objectID = "" layerID = "" infoID = "" @@ -75,6 +79,7 @@ module UMDInventorToPointer { internal { frame = "737 233 160 64" + moduleGroupName = "" windows { window _default { geometry = "214 330 210 217" @@ -88,7 +93,7 @@ instanceName = FullObjectPointer priority = 10000 debugComment = "" - Pointer = 181904056 + Pointer = 0x1A2F2960 objectID = "" layerID = "" infoID = "" @@ -97,6 +102,7 @@ module SoGroup { internal { frame = "1005 481 88 64" + moduleGroupName = "" windows { window _automatic { geometry = "92 111 208 173" @@ -113,6 +119,7 @@ module UMDPointerToInventor { internal { frame = "665 573 160 56" + moduleGroupName = "" } fields { instanceName = UMDPointerToInventor @@ -127,6 +134,7 @@ module SoMaterial { internal { frame = "881 489 96 64" + moduleGroupName = "" windows { window _default { geometry = "254 372 173 188" @@ -161,6 +169,7 @@ module ObjInfo { internal { frame = "709 641 72 64" + moduleGroupName = "" windows { window _default { geometry = "350 133 578 410" @@ -187,9 +196,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE @@ -218,6 +224,7 @@ module SoGroup { internal { frame = "945 153 80 64" + moduleGroupName = "" windows { window _viewer { geometry = "26 45 400 402" @@ -244,3 +251,4 @@ info.acceptedObjects = info.searchObjPattern View3D.children = Visible.self } +networkModel = "" Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/METKIsoSurface.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/METKIsoSurface.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKRenderModes/METKIsoSurface.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -5,6 +5,7 @@ module METKStructureGroupBrowser { internal { frame = "937 253 192 56" + moduleGroupName = "" } fields { instanceName = METKStructureGroupBrowser @@ -15,6 +16,7 @@ valueEntry = objectID showCeckBox = TRUE writeToObjMgr = TRUE + disableGrouping = FALSE setValuesByCheckedObjIdString = FALSE checkBoxLayer = Appearance checkBoxInfo = Visible @@ -24,6 +26,7 @@ module SoSeparator { internal { frame = "453 105 104 64" + moduleGroupName = "" windows { window _viewer { geometry = "114 133 400 402" @@ -44,6 +47,7 @@ module SoSwitch { internal { frame = "457 181 96 56" + moduleGroupName = "" windows { window _default { geometry = "180 199 195 94" @@ -61,6 +65,7 @@ module SoGroup { internal { frame = "345 261 128 56" + moduleGroupName = "" } fields { instanceName = SoGroup @@ -69,6 +74,7 @@ module SoDepthPeelRenderer { internal { frame = "509 261 152 56" + moduleGroupName = "" windows { window _default { geometry = "654 479 299 316" @@ -106,6 +112,7 @@ module ObjConstrainedIterator { internal { frame = "753 253 160 56" + moduleGroupName = "" } fields { instanceName = ObjConstrainedIterator @@ -122,6 +129,7 @@ module SoGroup { internal { frame = "473 457 80 64" + moduleGroupName = "" windows { window _viewer { geometry = "92 111 400 402" @@ -138,6 +146,7 @@ module SoGroup { internal { frame = "385 377 80 64" + moduleGroupName = "" windows { window _automatic { geometry = "92 111 208 173" @@ -154,6 +163,7 @@ module SoGroup { internal { frame = "561 377 80 64" + moduleGroupName = "" } fields { instanceName = clipYes @@ -162,6 +172,7 @@ module ObjInfo { internal { frame = "789 425 72 64" + moduleGroupName = "" windows { window _default { geometry = "597 36 539 1016" @@ -188,9 +199,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = Ready intValue = 0 boolValue = FALSE @@ -227,3 +235,4 @@ clipNo.children = "" clipYes.children = "" } +networkModel = "" Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKSafetyMargin.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKSafetyMargin.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKSafetyMargin.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -175,9 +175,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStatus.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStatus.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStatus.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -47,9 +47,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStructureDetails.mlab =================================================================== --- trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStructureDetails.mlab 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Modules/Macros/MedicalExplorationToolkit/METKStructureDetails.mlab 2009-06-17 08:36:42 UTC (rev 82) @@ -31,9 +31,6 @@ objectPrivate = FALSE layerPrivate = FALSE infoPrivate = FALSE - objectNetCommMode = Default - layerNetCommMode = Default - infoNetCommMode = Default stringValue = "" intValue = 0 boolValue = FALSE Modified: trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.cpp =================================================================== --- trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.cpp 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.cpp 2009-06-17 08:36:42 UTC (rev 82) @@ -85,7 +85,7 @@ if (field == inInventor) { - _pointer->setStringValue(inInventor->getStringValue()); + _pointer->setIntValue(kBasics::hex2int(inInventor->getStringValue())); writePointer(); } @@ -125,11 +125,11 @@ if (&obj) { if (!obj.hasAttribute(fieldLayerID->getStringValue(), fieldInfoID->getStringValue())) { omAttribute& attrNew = (*oc)[fieldObjectID->getStringValue()][fieldLayerID->getStringValue()][fieldInfoID->getStringValue()]; - attrNew.set_MLint32(_pointer->getIntValue()); + attrNew.set_MLint32(_pointer->getIntValue()); attrNew.flags().markPersistent(false); } else{ - (*oc)[fieldObjectID->getStringValue()][fieldLayerID->getStringValue()][fieldInfoID->getStringValue()].set_MLint32(_pointer->getIntValue()); + (*oc)[fieldObjectID->getStringValue()][fieldLayerID->getStringValue()][fieldInfoID->getStringValue()].set_MLint32(_pointer->getIntValue()); } sendNotification(); } Modified: trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.h =================================================================== --- trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.h 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Sources/ML/UMDInventorPointer/mlUMDInventorToPointer.h 2009-06-17 08:36:42 UTC (rev 82) @@ -37,7 +37,7 @@ #include <ObjMgr/mlObjMgrClient.h> -//#include "kBasics.h" +#include "kBasics.h" ML_START_NAMESPACE @@ -60,7 +60,7 @@ // ---------------------------------------------------------- //! - IntField *_pointer; + IntField* _pointer; SoNodeField* inInventor; StringField* fieldObjectID; Modified: trunk/Community/METK/Sources/common/kBasics.cpp =================================================================== --- trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Sources/common/kBasics.cpp 2009-06-17 08:36:42 UTC (rev 82) @@ -934,5 +934,23 @@ } + long hex2int(const string& hexStr) + { + char *offset; + if (hexStr.length( ) > 2) + { + if (hexStr[0] == '0' && hexStr[1] == 'x') + { + return strtol(hexStr.c_str( ), &offset, 0); + } + else + { + std::cout << "hex must start with 0x"; + return 0; + } + } + return 0; + } + } //namespace kBasics \ No newline at end of file Modified: trunk/Community/METK/Sources/common/kBasics.h =================================================================== --- trunk/Community/METK/Sources/common/kBasics.h 2009-06-17 07:04:07 UTC (rev 81) +++ trunk/Community/METK/Sources/common/kBasics.h 2009-06-17 08:36:42 UTC (rev 82) @@ -139,6 +139,7 @@ __COMMON_IMPORTEXPORT bool lineIntersection(POINT p1, POINT p2, POINT p3, POINT p4, POINT &intersectionPoint); __COMMON_IMPORTEXPORT bool boxIntersection(POINT r1_corner1, POINT r1_corner2, POINT r2_corner1, POINT r2_corner2, BOX &intersectionBox); __COMMON_IMPORTEXPORT bool pointInBox(POINTF p1, POINT corner1, POINT corner2); + __COMMON_IMPORTEXPORT long hex2int(const string& hexStr); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-17 07:04:14
|
Revision: 81 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=81&view=rev Author: wolfspindler Date: 2009-06-17 07:04:07 +0000 (Wed, 17 Jun 2009) Log Message: ----------- ADDED: -METK package added to generated doxygen files Modified Paths: -------------- trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt Modified: trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt =================================================================== --- trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt 2009-06-16 16:14:53 UTC (rev 80) +++ trunk/Community/General/Documentation/Sources/CommunitySourcesDoxygenConfig.txt 2009-06-17 07:04:07 UTC (rev 81) @@ -1,5 +1,5 @@ PROJECT_NAME = "C++ Reference of MeVisLab Community Sources" -INPUT = $${MLAB_Community_General}/Sources $${MLAB_Community_General}/Modules +INPUT = $${MLAB_Community_General}/Sources $${MLAB_Community_General}/Modules $${MLAB_Community_METK}/Sources $${MLAB_Community_METK}/Modules FILE_PATTERNS = *.h *.hxx *.py *.js ENABLED_SECTIONS = USE_MCS_GLOBAL_DOXYGEN_DOC IGNORE_PREFIX = MLAB This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2009-06-16 16:14:56
|
Revision: 80 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=80&view=rev Author: wolfspindler Date: 2009-06-16 16:14:53 +0000 (Tue, 16 Jun 2009) Log Message: ----------- ENH: -METK package added. Modified Paths: -------------- trunk/Community/General/Configuration/Installers/AddOns/MeVisLabCommunityAddOn.mlinstall Modified: trunk/Community/General/Configuration/Installers/AddOns/MeVisLabCommunityAddOn.mlinstall =================================================================== --- trunk/Community/General/Configuration/Installers/AddOns/MeVisLabCommunityAddOn.mlinstall 2009-06-16 15:04:06 UTC (rev 79) +++ trunk/Community/General/Configuration/Installers/AddOns/MeVisLabCommunityAddOn.mlinstall 2009-06-16 16:14:53 UTC (rev 80) @@ -24,6 +24,12 @@ + Modules + Documentation\Publish +SWITCH_PACKAGE Community/METK ++ Package.def +INCLUDE $(MLAB_MeVis_Foundation)/Configuration/Installers/Shared/LibDll/typicalPackage.mli ++ Modules ++ Documentation\Publish + SWITCH_PACKAGE Community/ThirdParty + Package.def INCLUDE $(MLAB_MeVis_Foundation)/Configuration/Installers/Shared/LibDll/typicalPackage.mli This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |