Skip to content

Commit

Permalink
Move some includes, tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Nov 4, 2016
1 parent ef930f3 commit 9e0b740
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 236 deletions.
14 changes: 7 additions & 7 deletions OMEdit/OMEditGUI/Animation/ExtraShapes.cpp
Expand Up @@ -81,13 +81,13 @@ Pipecylinder::Pipecylinder(float rI, float rO, float l) :

//THE BASE PLANE VERTICES
// inner base ring
for (int i = 0; i < nEdges; i++) {
for (int i = 0; i < nEdges; i++) {
vertices->push_back(osg::Vec3(sin(phi*i)*rI, cos(phi*i)*rI, 0));
normals->push_back(osg::Vec3(0.0f,0.0f,-1.0f));
vertIdx++;
}
// outer base ring
for (int i = 0; i < nEdges; i++) {
for (int i = 0; i < nEdges; i++) {
vertices->push_back(osg::Vec3(sin(phi*i)*rO, cos(phi*i)*rO, 0));
normals->push_back(osg::Vec3(0.0f,0.0f,-1.0f));
vertIdx++;
Expand Down Expand Up @@ -142,7 +142,7 @@ Pipecylinder::Pipecylinder(float rI, float rO, float l) :
}

//AND AGAIN FOR THE OUTER LATERAL PLANES
for (int i = 0; i < nEdges; i++) {
for (int i = 0; i < nEdges; i++) {
int j = i+1;
// the vertices
vertices->push_back(osg::Vec3(sin(phi*i)*rO, cos(phi*i)*rO, 0));
Expand All @@ -166,7 +166,7 @@ Pipecylinder::Pipecylinder(float rI, float rO, float l) :
}

//AND AGAIN FOR THE INNER LATERAL PLANES
for (int i = 0; i < nEdges; i++) {
for (int i = 0; i < nEdges; i++) {
int j = i+1;
// the vertices
vertices->push_back(osg::Vec3(sin(phi*i)*rI, cos(phi*i)*rI, 0));
Expand Down Expand Up @@ -257,7 +257,7 @@ float Spring::angleBetweenVectors(osg::Vec3f vec1, osg::Vec3f vec2)
*/
osg::Vec3f Spring::rotateX(osg::Vec3f vec, float phi)
{
return osg::Vec3f( vec[0],
return osg::Vec3f( vec[0],
vec[1] * std::cos(phi) - vec[2] * std::sin(phi),
vec[1] * std::sin(phi) + vec[2] * std::cos(phi));
}
Expand All @@ -271,7 +271,7 @@ osg::Vec3f Spring::rotateX(osg::Vec3f vec, float phi)
*/
osg::Vec3f Spring::rotateY(osg::Vec3f vec, float phi)
{
return osg::Vec3f( vec[2] * std::sin(phi) + vec[0] * std::cos(phi),
return osg::Vec3f( vec[2] * std::sin(phi) + vec[0] * std::cos(phi),
vec[1],
vec[2] * std::cos(phi) - vec[0] * std::sin(phi));
}
Expand All @@ -285,7 +285,7 @@ osg::Vec3f Spring::rotateY(osg::Vec3f vec, float phi)
*/
osg::Vec3f Spring::rotateZ(osg::Vec3f vec, float phi)
{
return osg::Vec3f( vec[0] * std::cos(phi) - vec[1] * std::sin(phi),
return osg::Vec3f( vec[0] * std::cos(phi) - vec[1] * std::sin(phi),
vec[0] * std::sin(phi) + vec[1] * std::cos(phi),
vec[2]);
}
Expand Down
66 changes: 33 additions & 33 deletions OMEdit/OMEditGUI/Animation/Shapes.cpp
Expand Up @@ -35,24 +35,24 @@
#include "Shapes.h"

ShapeObjectAttribute::ShapeObjectAttribute()
: isConst(true),
exp(0.0),
cref("NONE")
//fmuValueRef(0)
: isConst(true),
exp(0.0),
cref("NONE")
//fmuValueRef(0)
{
}

ShapeObjectAttribute::ShapeObjectAttribute(float value)
: isConst(true),
exp(value),
cref("NONE")
//fmuValueRef(0)
: isConst(true),
exp(value),
cref("NONE")
//fmuValueRef(0)
{
}

std::string ShapeObjectAttribute::getValueString() const
{
return std::to_string(exp) + " (" + /*std::to_string(fmuValueRef) + */") " + std::to_string(isConst) + " ";
return std::to_string(exp) + " (" + /*std::to_string(fmuValueRef) + */") " + std::to_string(isConst) + " ";
}


Expand All @@ -67,30 +67,30 @@ ShapeObject::ShapeObject()
_mat(osg::Matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)),
_extra(ShapeObjectAttribute(0.0))
{
_r[0] = ShapeObjectAttribute(0.1);
_r[1] = ShapeObjectAttribute(0.1);
_r[2] = ShapeObjectAttribute(0.1);
_rShape[0] = ShapeObjectAttribute(0.0);
_rShape[1] = ShapeObjectAttribute(0.0);
_rShape[2] = ShapeObjectAttribute(0.0);
_lDir[0] = ShapeObjectAttribute(1.0);
_lDir[1] = ShapeObjectAttribute(0.0);
_lDir[2] = ShapeObjectAttribute(0.0);
_wDir[0] = ShapeObjectAttribute(0.0);
_wDir[1] = ShapeObjectAttribute(1.0);
_wDir[2] = ShapeObjectAttribute(0.0);
_color[0] = ShapeObjectAttribute(255.0);
_color[1] = ShapeObjectAttribute(255.0);
_color[2] = ShapeObjectAttribute(255.0);
_T[0] = ShapeObjectAttribute(0.0);
_T[1] = ShapeObjectAttribute(0.0);
_T[2] = ShapeObjectAttribute(1.0);
_T[3] = ShapeObjectAttribute(1.0);
_T[4] = ShapeObjectAttribute(0.0);
_T[5] = ShapeObjectAttribute(0.0);
_T[6] = ShapeObjectAttribute(0.0);
_T[7] = ShapeObjectAttribute(1.0);
_T[8] = ShapeObjectAttribute(0.0);
_r[0] = ShapeObjectAttribute(0.1);
_r[1] = ShapeObjectAttribute(0.1);
_r[2] = ShapeObjectAttribute(0.1);
_rShape[0] = ShapeObjectAttribute(0.0);
_rShape[1] = ShapeObjectAttribute(0.0);
_rShape[2] = ShapeObjectAttribute(0.0);
_lDir[0] = ShapeObjectAttribute(1.0);
_lDir[1] = ShapeObjectAttribute(0.0);
_lDir[2] = ShapeObjectAttribute(0.0);
_wDir[0] = ShapeObjectAttribute(0.0);
_wDir[1] = ShapeObjectAttribute(1.0);
_wDir[2] = ShapeObjectAttribute(0.0);
_color[0] = ShapeObjectAttribute(255.0);
_color[1] = ShapeObjectAttribute(255.0);
_color[2] = ShapeObjectAttribute(255.0);
_T[0] = ShapeObjectAttribute(0.0);
_T[1] = ShapeObjectAttribute(0.0);
_T[2] = ShapeObjectAttribute(1.0);
_T[3] = ShapeObjectAttribute(1.0);
_T[4] = ShapeObjectAttribute(0.0);
_T[5] = ShapeObjectAttribute(0.0);
_T[6] = ShapeObjectAttribute(0.0);
_T[7] = ShapeObjectAttribute(1.0);
_T[8] = ShapeObjectAttribute(0.0);
}

void ShapeObject::dumpVisAttributes() const
Expand Down
30 changes: 14 additions & 16 deletions OMEdit/OMEditGUI/Animation/Shapes.h
Expand Up @@ -36,9 +36,7 @@

#include <iostream>

#include "util/read_matlab4.h"
#include "rapidxml.hpp"
//#include "fmilib.h"
#include <osg/Vec3f>
#include <osg/Matrix>
#include <osg/Uniform>
Expand All @@ -47,26 +45,26 @@
class ShapeObjectAttribute
{
public:
ShapeObjectAttribute();
ShapeObjectAttribute(float value);
~ShapeObjectAttribute() = default;
std::string getValueString() const;
ShapeObjectAttribute();
ShapeObjectAttribute(float value);
~ShapeObjectAttribute() = default;
std::string getValueString() const;
public:
bool isConst;
float exp;
std::string cref;
//fmi1_value_reference_t fmuValueRef;
bool isConst;
float exp;
std::string cref;
//fmi1_value_reference_t fmuValueRef;
};

class ShapeObject
{
public:
ShapeObject();
~ShapeObject() = default;
ShapeObject(const ShapeObject&) = default;
ShapeObject& operator=(const ShapeObject&) = default;
void dumpVisAttributes() const;
//void fetchVisAttributes(rapidxml::xml_node<>* node, ModelicaMatReader matReader,/* fmi1_import_t* fmu,*/ double time, bool useFMU);
ShapeObject();
~ShapeObject() = default;
ShapeObject(const ShapeObject&) = default;
ShapeObject& operator=(const ShapeObject&) = default;
void dumpVisAttributes() const;
//void fetchVisAttributes(rapidxml::xml_node<>* node, ModelicaMatReader matReader,/* fmi1_import_t* fmu,*/ double time, bool useFMU);
public:
std::string _id;
std::string _type;
Expand Down
62 changes: 31 additions & 31 deletions OMEdit/OMEditGUI/Animation/TimeManager.cpp
Expand Up @@ -35,113 +35,113 @@
#include "TimeManager.h"

TimeManager::TimeManager(const double simTime, const double realTime, const double realTimeFactor, const double visTime,
const double hVisual, const double startTime, const double endTime)
: _simTime(simTime),
_realTime(realTime),
_realTimeFactor(realTimeFactor),
_visTime(visTime),
_hVisual(hVisual),
_startTime(startTime),
_endTime(endTime),
_pause(true),
mSpeedUp(1.0),
_visualTimer()
const double hVisual, const double startTime, const double endTime)
: _simTime(simTime),
_realTime(realTime),
_realTimeFactor(realTimeFactor),
_visTime(visTime),
_hVisual(hVisual),
_startTime(startTime),
_endTime(endTime),
_pause(true),
mSpeedUp(1.0),
_visualTimer()
{
}

void TimeManager::updateTick()
{
_visualTimer.tick();
_realTime = _visualTimer.time_m() / 1000.0;
_visualTimer.tick();
_realTime = _visualTimer.time_m() / 1000.0;
}

int TimeManager::getTimeFraction()
{
return int(_visTime / (_endTime - _startTime)*100);
return int(_visTime / (_endTime - _startTime)*100);
}

double TimeManager::getEndTime() const
{
return _endTime;
return _endTime;
}

void TimeManager::setEndTime(const double endTime)
{
_endTime = endTime;
_endTime = endTime;
}

double TimeManager::getStartTime() const
{
return _startTime;
return _startTime;
}

void TimeManager::setStartTime(const double startTime)
{
_startTime = startTime;
_startTime = startTime;
}

double TimeManager::getSimTime() const
{
return _simTime;
return _simTime;
}

void TimeManager::setSimTime(const double simTime)
{
_simTime = simTime;
_simTime = simTime;
}

double TimeManager::getVisTime() const
{
return _visTime;
return _visTime;
}

void TimeManager::setVisTime(const double visTime)
{
_visTime = visTime;
_visTime = visTime;
}

double TimeManager::getHVisual() const
{
return _hVisual;
return _hVisual;
}

void TimeManager::setHVisual(const double hVis)
{
_hVisual = hVis;
_hVisual = hVis;
}


double TimeManager::getRealTime() const
{
return _realTime;
return _realTime;
}

double TimeManager::getRealTimeFactor() const
{
return _realTimeFactor;
return _realTimeFactor;
}

void TimeManager::setRealTimeFactor(const double rtf)
{
_realTimeFactor = rtf;
_realTimeFactor = rtf;
}

bool TimeManager::isPaused() const
{
return _pause;
return _pause;
}

void TimeManager::setPause(const bool status)
{
_pause = status;
_pause = status;
}
void TimeManager::setSpeedUp(double value)
{
mSpeedUp = value;
mSpeedUp = value;
}

double TimeManager::getSpeedUp()
{
return mSpeedUp;
return mSpeedUp;
}

0 comments on commit 9e0b740

Please sign in to comment.