Base: fixes #10462: mesh.unite() causes segementaion fault
This commit is contained in:
@@ -955,7 +955,8 @@ void InventorBuilder::endSeparator()
|
||||
* A more elaborate description of the constructor.
|
||||
*/
|
||||
Builder3D::Builder3D()
|
||||
: InventorBuilder(result)
|
||||
: result{}
|
||||
, builder{result}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1008,6 +1009,21 @@ void Builder3D::saveToFile(const char* FileName)
|
||||
file << result.str();
|
||||
}
|
||||
|
||||
void Builder3D::addNode(const NodeItem& item)
|
||||
{
|
||||
builder.addNode(item);
|
||||
}
|
||||
|
||||
void Builder3D::beginSeparator()
|
||||
{
|
||||
builder.beginSeparator();
|
||||
}
|
||||
|
||||
void Builder3D::endSeparator()
|
||||
{
|
||||
builder.endSeparator();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -608,7 +608,6 @@ public:
|
||||
* \brief Closes the last added separator node.
|
||||
*/
|
||||
void endSeparator();
|
||||
/** @name Appearance handling */
|
||||
|
||||
private:
|
||||
void increaseIndent();
|
||||
@@ -648,11 +647,11 @@ private:
|
||||
* \endcode
|
||||
* \see Base::ConsoleSingleton
|
||||
*/
|
||||
class BaseExport Builder3D : public InventorBuilder
|
||||
class BaseExport Builder3D
|
||||
{
|
||||
public:
|
||||
Builder3D();
|
||||
~Builder3D() override;
|
||||
~Builder3D();
|
||||
|
||||
/// clear the string buffer
|
||||
void clear();
|
||||
@@ -665,9 +664,24 @@ public:
|
||||
void saveToFile(const char* FileName);
|
||||
//@}
|
||||
|
||||
/*!
|
||||
* \brief addNode
|
||||
* Writes the content of the added node to the output stream.
|
||||
*/
|
||||
void addNode(const NodeItem&);
|
||||
/*!
|
||||
* \brief Sets a separator node.
|
||||
*/
|
||||
void beginSeparator();
|
||||
/*!
|
||||
* \brief Closes the last added separator node.
|
||||
*/
|
||||
void endSeparator();
|
||||
|
||||
private:
|
||||
/// the result string
|
||||
std::stringstream result;
|
||||
InventorBuilder builder;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "Base/Builder3D.h"
|
||||
#include <QString>
|
||||
#include <Base/Builder3D.h>
|
||||
|
||||
TEST(Builder, one)
|
||||
TEST(Builder3D, openInventor)
|
||||
{
|
||||
QString ss {};
|
||||
Base::Builder3D builder;
|
||||
builder.beginSeparator();
|
||||
builder.endSeparator();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ target_sources(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Axis.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Bitmask.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BoundBox.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Builder3D.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CoordinateSystem.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DualNumber.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DualQuaternion.cpp
|
||||
|
||||
Reference in New Issue
Block a user