14 #include <QStringList>
15 #include <vtkPointData.h>
16 #include <vtkPolyData.h>
17 #include <vtkPolyDataMapper.h>
19 #include <vtkCellArray.h>
20 #include <vtkProperty.h>
21 #include <vtkMatrix4x4.h>
39 mActor = vtkActorPtr::New();
52 mLines = vtkCellArrayPtr::New();
91 mActor->GetProperty()->SetColor(color.redF(), color.greenF(), color.blueF());
99 return QString(
"Shape x [cm]");
102 return QString(
"Shape y [cm]");
105 return QString(
"Shape z [cm]");
136 QStringList bufferList = buffer.split(
" ");
138 for(
int i = 0; i <
mAxis.size(); ++i)
160 if((bufferList.size() < 2) || !this->toInt(bufferList[pos++], numValues))
164 int stopPos = pos + numValues;
165 if(stopPos > bufferList.size())
167 CX_LOG_WARNING() <<
"ReadFbgsMessage::readPosForOneAxis: Buffer don't have enough (" << numValues <<
") values along axis: " <<
getAxisString(axis);
170 for(; pos < stopPos; ++pos)
173 if(!this->
toDouble(bufferList[pos], value))
175 axisVextor->push_back(value*10);
183 value =
string.toInt(&ok);
185 CX_LOG_WARNING() <<
"ReadFbgsMessage::toInt: Cannot convert " <<
string <<
" to int";
191 string =
string.split(
'\n')[0];
193 value =
string.toDouble(&ok);
197 ok = this->
toInt(
string, intValue);
198 value = double(intValue);
200 CX_LOG_WARNING() <<
"ReadFbgsMessage::toDouble: Cannot convert " <<
string <<
" to double";
208 for(
int i = startFrom; i < bufferList.size(); ++i)
209 if (bufferList[i] == axisString)
212 CX_LOG_WARNING() <<
"ReadFbgsMessage::getAxisStringPosition: Could't find separator string: " << axisString;
222 CX_LOG_WARNING() <<
"ReadFbgsMessage::createPolyData: Not equal number of position data in all axes";
231 mPoints->InsertNextPoint(p_pr.begin());
236 std::vector<vtkIdType> ids(
mPoints->GetNumberOfPoints());
237 for (
unsigned i=0; i<ids.size(); ++i)
239 mLines->InsertNextCell(ids.size(), &(*ids.begin()));
269 int pos1 = pos - localRange;
270 int pos2 = pos + localRange;
309 mMesh->getProperties().mLineWidth->setValue(5);
330 QString export_folder =
mServices->session()->getSubFolder(
"Export");
331 QString filename = export_folder+
"/"+
mMesh->getUid()+
"_" + QDateTime::currentDateTime().toString(
timestampSecondsFormat()) +
".vtk";