Commit 5630b522 authored by Kitware Robot's avatar Kitware Robot Committed by Ben Boeckel

clang-format: format the entire codebase

This allows the robot to enforce formatting and fix formatting issues
automatically.
parent 6a034a08
Pipeline #56466 passed with stage

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -9,12 +9,14 @@
//=========================================================================
#include <functional>
struct favorite_int {
int operator() () { return 42; }
struct favorite_int
{
int operator()() { return 42; }
};
struct conditional_int {
int operator() (float x) { return 2 * static_cast<int>(x); }
struct conditional_int
{
int operator()(float x) { return 2 * static_cast<int>(x); }
};
int main(int, char**)
......@@ -23,5 +25,5 @@ int main(int, char**)
f = favorite_int();
std::function<int()> g;
g = std::bind<float>(conditional_int(), 21.0);
return (f() == 42 && g() == 42 ) ? 0 : 1;
return (f() == 42 && g() == 42) ? 0 : 1;
}
......@@ -13,12 +13,14 @@
#include <boost/functional.hpp>
#include <boost/mpl/placeholders.hpp>
struct favorite_int {
int operator() () { return 42; }
struct favorite_int
{
int operator()() { return 42; }
};
struct conditional_int {
int operator() (float x) { return 2 * static_cast<int>(x); }
struct conditional_int
{
int operator()(float x) { return 2 * static_cast<int>(x); }
};
int main(int, char**)
......@@ -27,5 +29,5 @@ int main(int, char**)
f = favorite_int();
boost::function<int()> g;
g = boost::bind<float>(conditional_int(), 21.0);
return (f() == 42 && g() == 42 ) ? 0 : 1;
return (f() == 42 && g() == 42) ? 0 : 1;
}
......@@ -9,12 +9,14 @@
//=========================================================================
#include <tr1/functional>
struct favorite_int {
int operator() () { return 42; }
struct favorite_int
{
int operator()() { return 42; }
};
struct conditional_int {
int operator() (float x) { return 2 * static_cast<int>(x); }
struct conditional_int
{
int operator()(float x) { return 2 * static_cast<int>(x); }
};
int main(int, char**)
......@@ -23,5 +25,5 @@ int main(int, char**)
f = favorite_int();
std::tr1::function<int()> g;
g = std::tr1::bind<float>(conditional_int(), 21.0);
return (f() == 42 && g() == 42 ) ? 0 : 1;
return (f() == 42 && g() == 42) ? 0 : 1;
}
......@@ -19,26 +19,30 @@
class vtkUnstructuredGrid;
namespace smtk {
namespace bridge {
namespace tutorial {
namespace smtk
{
namespace bridge
{
namespace tutorial
{
// ++ 2 ++
/// The types of entities in a VTK "model"
enum EntityType
{
VTK_POINT, // The entity is a point
VTK_CELL, // The entity is a vertex, edge, face, or volume
VTK_GROUP, // The entity is a group (of points and/or cells)
VTK_POINT_DATUM, // The entity is a property associated with a point
VTK_CELL_DATUM // The entity is a property associated with a cell
VTK_POINT, // The entity is a point
VTK_CELL, // The entity is a vertex, edge, face, or volume
VTK_GROUP, // The entity is a group (of points and/or cells)
VTK_POINT_DATUM, // The entity is a property associated with a point
VTK_CELL_DATUM // The entity is a property associated with a cell
};
/// A "handle" for a VTK entity (point, cell, property, etc.)
struct EntityHandle {
EntityType entityType; //!< Describes the type of VTK entity
int entityRelation; //!< A modifier for the entity type (to select an array or boundary)
vtkIdType entityId; //!< The offset in the array of entities describing this entity.
struct EntityHandle
{
EntityType entityType; //!< Describes the type of VTK entity
int entityRelation; //!< A modifier for the entity type (to select an array or boundary)
vtkIdType entityId; //!< The offset in the array of entities describing this entity.
};
// -- 2 --
......@@ -61,41 +65,31 @@ public:
smtk::model::EntityRef toEntityRef(const EntityHandle& ent);
// These methods may be provided as needed.
static int staticSetup(
const std::string& optName,
const smtk::model::StringList& optVal);
virtual int setup(
const std::string& optName,
const smtk::model::StringList& optVal);
static int staticSetup(const std::string& optName, const smtk::model::StringList& optVal);
virtual int setup(const std::string& optName, const smtk::model::StringList& optVal);
protected:
Session();
// This is required of every session:
virtual SessionInfoBits transcribeInternal(
const smtk::model::EntityRef& entity,
SessionInfoBits requestedInfo);
const smtk::model::EntityRef& entity, SessionInfoBits requestedInfo);
vtkSmartPointer<vtkUnstructuredGrid> Model;
// ... };
// -- 1 --
void addRelations(
smtk::model::EntityRef& entityref,
std::vector<EntityHandle>& rels,
SessionInfoBits requestedInfo,
int depth);
bool addTessellation(
const smtk::model::EntityRef&,
const EntityHandle&);
void addRelations(smtk::model::EntityRef& entityref, std::vector<EntityHandle>& rels,
SessionInfoBits requestedInfo, int depth);
bool addTessellation(const smtk::model::EntityRef&, const EntityHandle&);
private:
Session(const Session&); // Not implemented.
void operator = (const Session&); // Not implemented.
Session(const Session&); // Not implemented.
void operator=(const Session&); // Not implemented.
};
} // namespace tutorial
} // namespace bridge
} // namespace tutorial
} // namespace bridge
} // namespace smtk
#endif // __smtk_ex_session_h
......@@ -5,10 +5,7 @@
int main()
{
std::cout
<< "Compiled with SMTK version "
<< smtk::common::Version::number()
<< "\n";
std::cout << "Compiled with SMTK version " << smtk::common::Version::number() << "\n";
return 0;
}
// -- 1 --
......@@ -31,7 +31,8 @@ using namespace smtk::common;
using namespace smtk::model;
using smtk::attribute::IntItem;
namespace ex {
namespace ex
{
// ++ 2 ++
OperatorResult CounterOperator::operateInternal()
......@@ -40,28 +41,22 @@ OperatorResult CounterOperator::operateInternal()
OperatorSpecification params = this->specification();
// Get the input model to be processed:
Model model =
params->findModelEntity("model")->value();
Model model = params->findModelEntity("model")->value();
// Decide whether we should count cells or groups
// of the model:
int countGroups =
params->findInt("count groups")->value();
int countGroups = params->findInt("count groups")->value();
// Create the attribute holding the results of
// our operation using a convenience method
// provided by the Operator base class.
// Our operation is simple; we always succeed.
OperatorResult result =
this->createResult(OPERATION_SUCCEEDED);
OperatorResult result = this->createResult(OPERATION_SUCCEEDED);