Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Nov 6, 2023
1 parent 36c735f commit 943f48e
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportDrawIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ std::string exportToDrawIO(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportGraphviz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ std::string exportToGraphviz(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ std::string exportToJSON(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportJulia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ std::string exportToJulia(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportPetriLaTeX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ std::string exportToPetriLaTeX(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportPnEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ std::string exportToPNEditor(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
2 changes: 1 addition & 1 deletion src/Net/Formats/ExportSymfony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ std::string exportToSymfony(Net const& net, std::string const& filename)
return {};
}

} // namespace tpne
} // namespace tpne
20 changes: 10 additions & 10 deletions src/Net/Formats/ImportJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ std::string importFromJSON(Net& net, std::string const& filename)
if (!file)
{
error << "Failed opening '" << filename << "'. Reason was '"
<< strerror(errno) << "'" << std::endl;
<< strerror(errno) << "'" << std::endl;
return error.str();
}

Expand All @@ -50,7 +50,7 @@ std::string importFromJSON(Net& net, std::string const& filename)
catch (std::exception const& e)
{
error << "Failed parsing '" << filename << "'. Reason was '"
<< e.what() << "'" << std::endl;
<< e.what() << "'" << std::endl;
return error.str();
}

Expand All @@ -65,7 +65,7 @@ std::string importFromJSON(Net& net, std::string const& filename)
net.clear(TypeOfNet::TimedEventGraph);
} else {
error << "Failed parsing '" << filename << "'. Reason was '"
<< "Unknown type of net: " << type << "'" << std::endl;
<< "Unknown type of net: " << type << "'" << std::endl;
return error.str();
}

Expand All @@ -90,8 +90,8 @@ std::string importFromJSON(Net& net, std::string const& filename)
if ((from == nullptr) || (to == nullptr))
{
error << "Failed parsing '" << filename << "'. Reason was 'Arc "
<< a["from"] << " -> " << a["to"] << " refer to unknown nodes'"
<< std::endl;
<< a["from"] << " -> " << a["to"] << " refer to unknown nodes'"
<< std::endl;
return error.str();
}

Expand All @@ -103,21 +103,21 @@ std::string importFromJSON(Net& net, std::string const& filename)
if (duration < 0.0f)
{
error << "Failed parsing '" << filename << "'. Reason was 'Arc "
<< from->key << " -> " << to->key << " has negative duration'"
<< std::endl;
<< from->key << " -> " << to->key << " has negative duration'"
<< std::endl;
return error.str();
}
}
if (!net.addArc(*from, *to, duration))
{
error << "Failed loading " << filename
<< ". Arc " << from->key << " -> " << to->key
<< " is badly formed" << std::endl;
<< ". Arc " << from->key << " -> " << to->key
<< " is badly formed" << std::endl;
return error.str();
}
}

return {};
}

} // namespace tpne
} // namespace tpne
18 changes: 9 additions & 9 deletions src/Net/PetriNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ size_t Transition::howManyTokensCanBurnt() const

//------------------------------------------------------------------------------
Net::Net(TypeOfNet const type)
: m_type(type), name(to_str(type))
: m_type(type), name(to_str(type))
{}

//------------------------------------------------------------------------------
Expand All @@ -125,11 +125,11 @@ Net& Net::operator=(Net const& other)
for (auto const& it: other.m_arcs)
{
Node& from = (it.from.type == Node::Type::Place)
? reinterpret_cast<Node&>(m_places[it.from.id])
: reinterpret_cast<Node&>(m_transitions[it.from.id]);
? reinterpret_cast<Node&>(m_places[it.from.id])
: reinterpret_cast<Node&>(m_transitions[it.from.id]);
Node& to = (it.to.type == Node::Type::Place)
? reinterpret_cast<Node&>(m_places[it.to.id])
: reinterpret_cast<Node&>(m_transitions[it.to.id]);
? reinterpret_cast<Node&>(m_places[it.to.id])
: reinterpret_cast<Node&>(m_transitions[it.to.id]);
m_arcs.push_back(Arc(from, to, it.duration));
}
generateArcsInArcsOut();
Expand Down Expand Up @@ -234,7 +234,7 @@ Place& Net::addPlace(float const x, float const y, size_t const tokens)

//------------------------------------------------------------------------------
Place& Net::addPlace(size_t const id, std::string const& caption, float const x,
float const y, size_t const tokens)
float const y, size_t const tokens)
{
modified = true;
m_places.push_back(Place(id, caption, x, y, tokens));
Expand Down Expand Up @@ -311,9 +311,9 @@ bool Net::sanityArc(Node const& from, Node const& to, bool const strict) const
// Option 1: we simply fail (for example when loading file)
m_message.str("");
m_message << "Failed adding arc " << from.key
<< " --> " << to.key
<< ": nodes type shall not be the same"
<< std::endl;
<< " --> " << to.key
<< ": nodes type shall not be the same"
<< std::endl;
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Net/SparseMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct SparseMatrix // FIXME: redo manage (max,+) type
{
size_t currCol;

for (size_t pos = 0u; pos < i.size(); ++pos)
for (size_t pos = 0u; pos < i.size(); ++pos)
{
if (i[pos] == i_)
{
Expand All @@ -85,9 +85,9 @@ struct SparseMatrix // FIXME: redo manage (max,+) type
return d[pos];
}
}
}
}

return zero<T>();
return zero<T>();
}

//! \brief Option to display for C++ or for Julia
Expand Down
24 changes: 12 additions & 12 deletions src/Renderer/PetriEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ static void help()
{
std::stringstream help;
help << "Left button pressed: add a place" << std::endl
<< "Right button pressed: add a transition" << std::endl
<< "Middle button pressed: add an arc with the selected place or transition as origin" << std::endl
<< "Middle button release: end the arc with the selected place or transition as destination" << std::endl
<< "Middle button pressed: move the view" << std::endl;
<< "Right button pressed: add a transition" << std::endl
<< "Middle button pressed: add an arc with the selected place or transition as origin" << std::endl
<< "Middle button release: end the arc with the selected place or transition as destination" << std::endl
<< "Middle button pressed: move the view" << std::endl;

ImGui::Text("%s", help.str().c_str());
ImGui::EndTabItem();
Expand Down Expand Up @@ -193,17 +193,17 @@ static void console(Editor& editor)
if (logs[i].level == Messages::Level::Info)
{
ImGui::TextColored(ImVec4(0, 255, 0, 255), "%s[info]: %s",
logs[i].time.c_str(), logs[i].message.c_str());
logs[i].time.c_str(), logs[i].message.c_str());
}
else if (logs[i].level == Messages::Level::Error)
{
ImGui::TextColored(ImVec4(255, 0, 0, 255), "%s[error]: %s",
logs[i].time.c_str(), logs[i].message.c_str());
logs[i].time.c_str(), logs[i].message.c_str());
}
else
{
ImGui::TextColored(ImVec4(255, 0, 255, 255), "%s[warn]: %s",
logs[i].time.c_str(), logs[i].message.c_str());
logs[i].time.c_str(), logs[i].message.c_str());
}
}
ImGui::End();
Expand Down Expand Up @@ -777,7 +777,7 @@ void Editor::onDraw()
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
static void drawArrow(ImDrawList* draw_list, const float xa, const float ya,
const float xb, const float yb, const ImU32 color)
const float xb, const float yb, const ImU32 color)
{
// Orientation
const float teta = (yb - ya) / (xb - xa);
Expand Down Expand Up @@ -901,7 +901,7 @@ void Editor::drawPlace(Place const& place)
ImVec2 dim = ImGui::CalcTextSize(place.key.c_str());
ImVec2 ptext = p - ImVec2(dim.x / 2.0f, PLACE_RADIUS + dim.y);
draw_list->AddText(ptext, IM_COL32(0, 0, 0, 255),
show_place_captions ? place.caption.c_str() : place.key.c_str());
show_place_captions ? place.caption.c_str() : place.key.c_str());

// Draw the number of tokens
if (place.tokens == 0u)
Expand Down Expand Up @@ -973,7 +973,7 @@ void Editor::drawTransition(Transition const& transition)
ImVec2 dim = ImGui::CalcTextSize(transition.key.c_str());
ImVec2 ptext = p - ImVec2(dim.x / 2.0f, TRANS_HEIGHT + dim.y);
draw_list->AddText(ptext, IM_COL32(0, 0, 0, 255),
show_transition_captions ? transition.caption.c_str() : transition.key.c_str());
show_transition_captions ? transition.caption.c_str() : transition.key.c_str());
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -1043,7 +1043,7 @@ void Editor::load()
if (m_net.load(ImGuiFileDialog::Instance()->GetFilePathName()))
{
m_messages.setInfo("loaded with success " +
ImGuiFileDialog::Instance()->GetFilePathName());
ImGuiFileDialog::Instance()->GetFilePathName());
}
else
{
Expand Down Expand Up @@ -1083,7 +1083,7 @@ void Editor::exportTo(Exporter const& exporter)
if (error.empty())
{
m_messages.setInfo("saved with success " +
ImGuiFileDialog::Instance()->GetFilePathName());
ImGuiFileDialog::Instance()->GetFilePathName());
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions src/Renderer/PetriEditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Editor: public Application
//! dummy if you do not want to open a file.
//--------------------------------------------------------------------------
Editor(size_t const width, size_t const height, std::string const& title,
std::string const& project_path = {});
std::string const& project_path = {});

public:

Expand Down Expand Up @@ -63,12 +63,12 @@ class Editor: public Application
ImVec2 getMousePosition();
void handleArcOrigin();
void handleArcDestination();
/*
void align();
PetriNet::CriticalCycleResult findCriticalCycle();
bool screenshot();
bool changeTypeOfNet(TypeOfNet const type);
*/
/*
void align();
PetriNet::CriticalCycleResult findCriticalCycle();
bool screenshot();
bool changeTypeOfNet(TypeOfNet const type);
*/
void clear();

std::string getError() const
Expand Down

0 comments on commit 943f48e

Please sign in to comment.