All: Reformat according to new standard

This commit is contained in:
pre-commit-ci[bot]
2025-11-11 13:49:01 +01:00
committed by Kacper Donat
parent ef997f2259
commit 9fe130cd73
2390 changed files with 154630 additions and 115818 deletions

View File

@@ -21,10 +21,9 @@
***************************************************************************/
# include <cstring>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoSwitch.h>
#include <cstring>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoSwitch.h>
#include <Base/Exception.h>
@@ -34,8 +33,8 @@
#include "SoFCSelection.h"
using std::vector;
using std::string;
using std::vector;
using namespace Gui;
@@ -50,15 +49,15 @@ ViewProviderExtern::~ViewProviderExtern() = default;
void ViewProviderExtern::setModeByString(const char* name, const char* ivFragment)
{
SoInput in;
in.setBuffer((void*)ivFragment,std::strlen(ivFragment));
setModeBySoInput(name,in);
in.setBuffer((void*)ivFragment, std::strlen(ivFragment));
setModeBySoInput(name, in);
}
void ViewProviderExtern::setModeByFile(const char* name, const char* ivFileName)
{
SoInput in;
Base::ifstream file(Base::FileInfo(ivFileName), std::ios::in | std::ios::binary);
if (file){
if (file) {
std::streamoff size = 0;
std::streambuf* buf = file.rdbuf();
if (buf) {
@@ -77,17 +76,20 @@ void ViewProviderExtern::setModeByFile(const char* name, const char* ivFileName)
}
file.close();
in.setBuffer(&(content[0]),content.size());
setModeBySoInput(name,in);
in.setBuffer(&(content[0]), content.size());
setModeBySoInput(name, in);
}
}
void ViewProviderExtern::setModeBySoInput(const char* name, SoInput &ivFileInput)
void ViewProviderExtern::setModeBySoInput(const char* name, SoInput& ivFileInput)
{
SoSeparator * root = SoDB::readAll(&ivFileInput);
SoSeparator* root = SoDB::readAll(&ivFileInput);
if (root) {
std::vector<std::string>::iterator pos = std::find<std::vector<std::string>
::iterator,string>(modes.begin(),modes.end(),string(name));
std::vector<std::string>::iterator pos = std::find<std::vector<std::string>::iterator, string>(
modes.begin(),
modes.end(),
string(name)
);
if (pos == modes.end()) {
// new mode
modes.emplace_back(name);
@@ -110,7 +112,7 @@ void ViewProviderExtern::setModeBySoInput(const char* name, SoInput &ivFileInput
void ViewProviderExtern::adjustDocumentName(const char* docname)
{
for (int i=0; i<this->pcModeSwitch->getNumChildren(); i++) {
for (int i = 0; i < this->pcModeSwitch->getNumChildren(); i++) {
SoNode* child = this->pcModeSwitch->getChild(i);
adjustRecursiveDocumentName(child, docname);
}
@@ -121,9 +123,9 @@ void ViewProviderExtern::adjustRecursiveDocumentName(SoNode* child, const char*
if (child->getTypeId().isDerivedFrom(SoFCSelection::getClassTypeId())) {
static_cast<SoFCSelection*>(child)->documentName = docname;
}
else if (child->getTypeId().isDerivedFrom( SoGroup::getClassTypeId())) {
else if (child->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) {
SoGroup* group = static_cast<SoGroup*>(child);
for (int i=0; i<group->getNumChildren(); i++) {
for (int i = 0; i < group->getNumChildren(); i++) {
SoNode* subchild = group->getChild(i);
adjustRecursiveDocumentName(subchild, docname);
}