Base: remove deprecated methods of InventorBuilder

This commit is contained in:
wmayer
2022-12-12 20:50:59 +01:00
parent cfc97b80b1
commit 2e1ec82930
2 changed files with 0 additions and 417 deletions

View File

@@ -851,175 +851,6 @@ void InventorBuilder::endSeparator()
result << indent << "}\n";
}
void InventorBuilder::addInfo(const char* text)
{
result << indent << "Info { \n";
result << indent << " string \"" << text << "\"\n";
result << indent << "} \n";
}
void InventorBuilder::addLabel(const char* text)
{
result << indent << "Label { \n";
result << indent << " label \"" << text << "\"\n";
result << indent << "} \n";
}
void InventorBuilder::addBaseColor(const ColorRGB& rgb)
{
result << indent << "BaseColor { \n";
result << indent << " rgb "
<< rgb.red() << " " << rgb.green() << " " << rgb.blue() << '\n';
result << indent << "} \n";
}
void InventorBuilder::addMaterial(const ColorRGB& rgb, float transparency)
{
result << indent << "Material { \n";
result << indent << " diffuseColor "
<< rgb.red() << " " << rgb.green() << " " << rgb.blue() << '\n';
if (transparency > 0)
result << indent << " transparency " << transparency << '\n';
result << indent << "} \n";
}
void InventorBuilder::beginMaterial()
{
result << indent << "Material { \n";
increaseIndent();
result << indent << "diffuseColor [\n";
increaseIndent();
}
void InventorBuilder::endMaterial()
{
decreaseIndent();
result << indent << "]\n";
decreaseIndent();
result << indent << "}\n";
}
void InventorBuilder::addColor(const ColorRGB& rgb)
{
result << rgb.red() << " " << rgb.green() << " " << rgb.blue() << '\n';
}
void InventorBuilder::addMaterialBinding(BindingElement bind)
{
result << indent << "MaterialBinding { value "
<< bind.bindingAsString() << " } \n";
}
void InventorBuilder::addDrawStyle(DrawStyle drawStyle)
{
result << indent << "DrawStyle {\n"
<< indent << " style " << drawStyle.styleAsString() << '\n'
<< indent << " pointSize " << drawStyle.pointSize << '\n'
<< indent << " lineWidth " << drawStyle.lineWidth << '\n'
<< indent << " linePattern " << drawStyle.linePattern << '\n'
<< indent << "}\n";
}
void InventorBuilder::addShapeHints(float creaseAngle)
{
result << indent << "ShapeHints {\n"
<< indent << " creaseAngle " << creaseAngle << '\n'
<< indent << "}\n";
}
void InventorBuilder::addPolygonOffset(PolygonOffset polygonOffset)
{
result << indent << "PolygonOffset {\n"
<< indent << " factor " << polygonOffset.factor << '\n'
<< indent << " units " << polygonOffset.units << '\n'
<< indent << " styles " << polygonOffset.styleAsString() << '\n'
<< indent << " on " << (polygonOffset.on ? "TRUE" : "FALSE") << '\n'
<< indent << "}\n";
}
/**
* Starts the definition of point set.
* If possible don't make too many beginPoints() and endPoints() calls.
* Try to put all points in one set.
* @see endPoints()
*/
void InventorBuilder::beginPoints()
{
result << indent << "Coordinate3 { \n";
increaseIndent();
result << indent << "point [ \n";
increaseIndent();
}
/// insert a point in a point set
void InventorBuilder::addPoint(const Vector3f& pnt)
{
result << indent << pnt.x << " " << pnt.y << " " << pnt.z << ",\n";
}
void InventorBuilder::addPoints(const std::vector<Vector3f>& points)
{
for (const auto& pnt : points) {
addPoint(pnt);
}
}
/**
* Ends the point set operations and write the resulting inventor string.
* @see beginPoints()
*/
void InventorBuilder::endPoints()
{
decreaseIndent();
result << indent << "]\n";
decreaseIndent();
result << indent << "}\n";
}
/**
* Adds an SoPointSet node after creating an SoCordinate3 node with
* beginPoints() and endPoints().
* @see beginPoints()
* @see endPoints()
*/
void InventorBuilder::addPointSet()
{
result << indent << "PointSet { } \n";
}
void InventorBuilder::addSinglePoint(const Base::Vector3f &point, DrawStyle drawStyle, const ColorRGB& color)
{
result << indent << "Separator { ";
result << indent << " Material { ";
result << indent << " diffuseColor " << color.red() << " "<< color.green() << " "<< color.blue();
result << indent << " }";
result << indent << " MaterialBinding { value PER_PART } ";
result << indent << " DrawStyle { pointSize " << drawStyle.pointSize << "} ";
result << indent << " Coordinate3 { ";
result << indent << " point [ ";
result << point.x << " " << point.y << " " << point.z << ",";
result << indent << " ] ";
result << indent << " }";
result << indent << " PointSet { } ";
result << indent <<"}";
}
/**
* Adds a SoLineSet node after creating a SoCordinate3 node with
* beginPoints() and endPoints().
* @see beginPoints()
* @see endPoints()
*/
void InventorBuilder::addLineSet()
{
result << indent << "LineSet { } \n";
}
void InventorBuilder::addText(const char * text)
{
result << indent << " Text2 { string \" " << text << "\" " << "} \n";
}
/**
* Add a Text with a given position to the 3D set. The origin is the
* lower leftmost corner.
@@ -1127,82 +958,6 @@ void InventorBuilder::addLineSet(const std::vector<Vector3f>& points, DrawStyle
<< " } \n";
}
void InventorBuilder::addIndexedFaceSet(const std::vector<int>& indices)
{
if (indices.size() < 4)
return;
result << indent << "IndexedFaceSet { \n"
<< indent << " coordIndex [ \n";
increaseIndent();
increaseIndent();
std::vector<int>::const_iterator it_last_f = indices.end()-1;
int index=0;
for (std::vector<int>::const_iterator it = indices.begin(); it != indices.end(); ++it) {
if (index % 8 == 0)
result << indent;
if (it != it_last_f)
result << *it << ", ";
else
result << *it << " ] \n";
if (++index % 8 == 0)
result << '\n';
}
decreaseIndent();
decreaseIndent();
result << indent << "} \n";
}
void InventorBuilder::addFaceSet(const std::vector<int>& vertices)
{
result << indent << "FaceSet { \n"
<< indent << " numVertices [ \n";
increaseIndent();
increaseIndent();
std::vector<int>::const_iterator it_last_f = vertices.end()-1;
int index=0;
for (std::vector<int>::const_iterator it = vertices.begin(); it != vertices.end(); ++it) {
if (index % 8 == 0)
result << indent;
if (it != it_last_f)
result << *it << ", ";
else
result << *it << " ] \n";
if (++index % 8 == 0)
result << '\n';
}
decreaseIndent();
decreaseIndent();
result << indent << "} \n";
}
void InventorBuilder::beginNormal()
{
result << indent << "Normal { \n";
increaseIndent();
result << indent << "vector [ \n";
increaseIndent();
}
void InventorBuilder::endNormal()
{
decreaseIndent();
result << indent << "]\n";
decreaseIndent();
result << indent << "}\n";
}
void InventorBuilder::addNormalBinding(const char* binding)
{
result << indent << "NormalBinding {\n"
<< indent << " value " << binding << '\n'
<< indent << "}\n";
}
void InventorBuilder::addSingleTriangle(const Triangle& triangle, DrawStyle drawStyle, const ColorRGB& rgb)
{
std::string fs = "";
@@ -1253,82 +1008,6 @@ void InventorBuilder::addSinglePlane(const Vector3f& base, const Vector3f& eX, c
<< " } \n";
}
/**
* The number of control points must be numUControlPoints * numVControlPoints.
* The order in u or v direction of the NURBS surface is implicitly given by
* number of elements in uKnots - numUControlPoints or
* number of elements in vKnots - numVControlPoints.
*/
void InventorBuilder::addNurbsSurface(const std::vector<Base::Vector3f>& controlPoints,
int numUControlPoints, int numVControlPoints,
const std::vector<float>& uKnots,
const std::vector<float>& vKnots)
{
result << " Separator { \n"
<< " Coordinate3 { \n"
<< " point [ ";
for (std::vector<Base::Vector3f>::const_iterator it =
controlPoints.begin(); it != controlPoints.end(); ++it) {
if (it != controlPoints.begin())
result << ",\n ";
result << it->x << " " << it->y << " " << it->z;
}
result << " ]\n"
<< " }\n";
result << " NurbsSurface { \n"
<< " numUControlPoints " << numUControlPoints << '\n'
<< " numVControlPoints " << numVControlPoints << '\n'
<< " uKnotVector [ ";
int index = 0;
for (std::vector<float>::const_iterator it = uKnots.begin(); it != uKnots.end(); ++it) {
result << *it;
index++;
if ((it+1) < uKnots.end()) {
if (index % 4 == 0)
result << ",\n ";
else
result << ", ";
}
}
result << " ]\n"
<< " vKnotVector [ ";
for (std::vector<float>::const_iterator it = vKnots.begin(); it != vKnots.end(); ++it) {
result << *it;
index++;
if ((it+1) < vKnots.end()) {
if (index % 4 == 0)
result << ",\n ";
else
result << ", ";
}
}
result << " ]\n"
<< " }\n"
<< " }\n";
}
void InventorBuilder::addCone(float bottomRadius, float height)
{
result << indent << " Cone { bottomRadius " << bottomRadius << " height " << height << "} \n";
}
void InventorBuilder::addCylinder(float radius, float height)
{
result << indent << "Cylinder {\n"
<< indent << " radius " << radius << "\n"
<< indent << " height " << height << "\n"
<< indent << " parts (SIDES | TOP | BOTTOM)\n"
<< indent << "}\n";
}
void InventorBuilder::addSphere(float radius)
{
result << indent << "Sphere {\n"
<< indent << " radius " << radius << "\n"
<< indent << "}\n";
}
void InventorBuilder::addBoundingBox(const Vector3f& pt1, const Vector3f& pt2, DrawStyle drawStyle, const ColorRGB& rgb)
{
Base::Vector3f pt[8];