File: PlotManager.cpp

package info (click to toggle)
dyssol 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,184 kB
  • sloc: cpp: 53,870; sh: 85; python: 59; makefile: 11
file content (675 lines) | stat: -rw-r--r-- 17,297 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
/* Copyright (c) 2020, Dyssol Development Team.
 * Copyright (c) 2024, DyssolTEC GmbH.
 * All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */

#include "PlotManager.h"
#include "H5Handler.h"
#include "ContainerFunctions.h"
#include "DyssolStringConstants.h"

template <typename T>
void ResizeUniquePtrVector(std::vector<std::unique_ptr<T>>& _v, size_t _size)
{
	if (_v.size() == _size) return;
	if (_v.size() > _size)
		_v.resize(_size);
	else
	{
		_v.reserve(_size);
		for (size_t i = _v.size(); i < _size; ++i)
			_v.emplace_back(new T{ "" });
	}
}

////////////////////////////////////////////////////////////////////////////////
// CCurve
//

CCurve::CCurve(std::string _name) :
	m_name{ std::move(_name) }
{
}

CCurve::CCurve(double _z) :
	m_name{ StringFunctions::Double2String(_z) },
	m_valueZ{ _z }
{
}

std::string CCurve::GetName() const
{
	return m_name;
}

void CCurve::SetName(const std::string& _name)
{
	m_name = _name;
}

double CCurve::GetZValue() const
{
	return m_valueZ;
}

void CCurve::SetZValue(double _z)
{
	m_valueZ = _z;
}

void CCurve::AddPoint(double _x, double _y)
{
	m_values.emplace_back(_x, _y);
}

void CCurve::AddPoint(const CPoint& _point)
{
	m_values.push_back(_point);
}

void CCurve::AddPoints(const std::vector<double>& _x, const std::vector<double>& _y)
{
	if (_x.size() != _y.size()) return;
	m_values.reserve(m_values.size() + _x.size());
	for (size_t i = 0; i < _x.size(); ++i)
		m_values.emplace_back(_x[i], _y[i]);
}

void CCurve::AddPoints(const std::vector<CPoint>& _points)
{
	m_values.insert(m_values.end(), _points.begin(), _points.end());
}

std::vector<double> CCurve::GetXValues() const
{
	std::vector<double> res;
	res.reserve(m_values.size());
	for (const auto& point : m_values)
		res.push_back(point.x);
	return res;
}

std::vector<double> CCurve::GetYValues() const
{
	std::vector<double> res;
	res.reserve(m_values.size());
	for (const auto& point : m_values)
		res.push_back(point.y);
	return res;
}

std::vector<CPoint> CCurve::GetPoints() const
{
	return m_values;
}

void CCurve::RemovePoint(double _x)
{
	VectorDelete(m_values, [&](const CPoint& _p) { return _p.x == _x; });
}

void CCurve::ClearData()
{
	m_values.clear();
}

void CCurve::Clear()
{
	ClearData();
	m_name.clear();
}

void CCurve::SaveToFile(CH5Handler& _h5File, const std::string& _path) const
{
	if (!_h5File.IsValid()) return;

	// current version of save procedure
	_h5File.WriteAttribute(_path, StrConst::H5AttrSaveVersion, m_saveVersion);

	_h5File.WriteData(_path, StrConst::PlotMngr_H5CurveName,   m_name);
	_h5File.WriteData(_path, StrConst::PlotMngr_H5CurveZValue, m_valueZ);
	_h5File.WriteData(_path, StrConst::PlotMngr_H5CurveData,   m_values);
}

void CCurve::LoadFromFile(CH5Handler& _h5File, const std::string& _path)
{
	Clear();

	if (!_h5File.IsValid()) return;

	// current version of save procedure
	//const int version = _h5File.ReadAttribute(_path, StrConst::H5AttrSaveVersion);

	_h5File.ReadData(_path, StrConst::PlotMngr_H5CurveName,   m_name);
	_h5File.ReadData(_path, StrConst::PlotMngr_H5CurveZValue, m_valueZ);
	_h5File.ReadData(_path, StrConst::PlotMngr_H5CurveData,   m_values);
}

////////////////////////////////////////////////////////////////////////////////
// CPlot
//

CPlot::CPlot(std::string _name) :
	m_name{ std::move(_name) }
{
}

CPlot::CPlot(std::string _name, std::string _labelX, std::string _labelY) :
	m_name{ std::move(_name) },
	m_labelX{ std::move(_labelX) },
	m_labelY{ std::move(_labelY) }
{
}

CPlot::CPlot(std::string _name, std::string _labelX, std::string _labelY, std::string _labelZ) :
	m_name{ std::move(_name) },
	m_labelX{ std::move(_labelX) },
	m_labelY{ std::move(_labelY) },
	m_labelZ{ std::move(_labelZ) }
{
}

CPlot::CPlot(const CPlot& _other)
{
	m_curves.reserve(_other.m_curves.size());
	for (const auto& curve : _other.m_curves)
		m_curves.push_back(std::make_unique<CCurve>(*curve));
}

CPlot& CPlot::operator=(const CPlot& _other)
{
	if (this != &_other)
	{
		m_name = _other.m_name;
		m_labelX = _other.m_labelX;
		m_labelY = _other.m_labelY;
		m_labelZ = _other.m_labelZ;
		ResizeUniquePtrVector(m_curves, _other.m_curves.size());
		for (size_t i = 0; i < m_curves.size(); ++i)
			*m_curves[i] = *_other.m_curves[i];
	}
	return *this;
}

std::string CPlot::GetName() const
{
	return m_name;
}

void CPlot::SetName(const std::string& _name)
{
	m_name = _name;
}

std::string CPlot::GetLabelX() const
{
	return m_labelX;
}

std::string CPlot::GetLabelY() const
{
	return m_labelY;
}

std::string CPlot::GetLabelZ() const
{
	return m_labelZ;
}

void CPlot::SetLabelX(const std::string& _label)
{
	m_labelX = _label;
}

void CPlot::SetLabelY(const std::string& _label)
{
	m_labelY = _label;
}

void CPlot::SetLabelZ(const std::string& _label)
{
	m_labelZ = _label;
}

void CPlot::SetLabels(const std::string& _labelX, const std::string& _labelY)
{
	SetLabelX(_labelX);
	SetLabelY(_labelY);
}

void CPlot::SetLabels(const std::string& _labelX, const std::string& _labelY, const std::string& _labelZ)
{
	SetLabelX(_labelX);
	SetLabelY(_labelY);
	SetLabelZ(_labelZ);
}

CCurve* CPlot::AddCurve(const std::string& _name)
{
	if (GetCurve(_name)) return nullptr;
	m_curves.emplace_back(new CCurve{ _name });
	return m_curves.back().get();
}

CCurve* CPlot::AddCurve(const std::string& _name, const std::vector<double>& _x, const std::vector<double>& _y)
{
	auto* curve = AddCurve(_name);
	if (curve) curve->AddPoints(_x, _y);
	return curve;
}

CCurve* CPlot::AddCurve(const std::string& _name, const std::vector<CPoint>& _points)
{
	auto* curve = AddCurve(_name);
	if (curve) curve->AddPoints(_points);
	return curve;
}

std::vector<CCurve*> CPlot::AddCurves(const std::vector<std::string>& _names)
{
	if (std::any_of(_names.begin(), _names.end(), [&](const auto& name) { return GetCurve(name); })) return {};
	auto res = ReservedVector<CCurve*>(_names.size());
	for (const auto& name : _names)
		res.push_back(AddCurve(name));
	return res;
}

CCurve* CPlot::AddCurve(double _z)
{
	auto* curve = AddEmptyCurve(_z);
	return curve;
}

CCurve* CPlot::AddCurve(double _z, const std::vector<double>& _x, const std::vector<double>& _y)
{
	auto* curve = AddEmptyCurve(_z);
	if (curve) curve->AddPoints(_x, _y);
	return curve;
}

CCurve* CPlot::AddCurve(double _z, const std::vector<CPoint>& _points)
{
	auto* curve = AddEmptyCurve(_z);
	if (curve) curve->AddPoints(_points);
	return curve;
}

std::vector<CCurve*> CPlot::AddCurves(const std::vector<double>& _z)
{
	if (std::any_of(_z.begin(), _z.end(), [&](const auto& z) { return GetCurve(StringFunctions::Double2String(z)); })) return {};
	auto res = ReservedVector<CCurve*>(_z.size());
	for (const auto& z : _z)
		res.push_back(AddCurve(z));
	return res;
}

const CCurve* CPlot::GetCurve(size_t _index) const
{
	if (_index >= m_curves.size()) return {};
	return m_curves[_index].get();
}

CCurve* CPlot::GetCurve(size_t _index)
{
	return const_cast<CCurve*>(static_cast<const CPlot&>(*this).GetCurve(_index));
}

const CCurve* CPlot::GetCurve(const std::string& _name) const
{
	for (const auto& curve : m_curves)
		if (curve->GetName() == _name)
			return curve.get();
	return nullptr;
}

CCurve* CPlot::GetCurve(const std::string& _name)
{
	return const_cast<CCurve*>(static_cast<const CPlot&>(*this).GetCurve(_name));
}

const CCurve* CPlot::GetCurve(double _z) const
{
	for (const auto& curve : m_curves)
		if (curve->GetZValue() == _z)
			return curve.get();
	return nullptr;
}

CCurve* CPlot::GetCurve(double _z)
{
	return const_cast<CCurve*>(static_cast<const CPlot&>(*this).GetCurve(_z));
}

void CPlot::RemoveCurve(const std::string& _name)
{
	VectorDelete(m_curves, [&](const std::unique_ptr<CCurve>& s) { return s->GetName() == _name; });
}

void CPlot::RemoveCurve(double _z)
{
	VectorDelete(m_curves, [&](const std::unique_ptr<CCurve>& s) { return s->GetZValue() == _z; });
}

std::vector<const CCurve*> CPlot::GetAllCurves() const
{
	std::vector<const CCurve*> res;
	res.reserve(m_curves.size());
	for (const auto& curve : m_curves)
		res.push_back(curve.get());
	return res;
}

std::vector<CCurve*> CPlot::GetAllCurves()
{
	std::vector<CCurve*> res;
	res.reserve(m_curves.size());
	for (const auto& curve : m_curves)
		res.push_back(curve.get());
	return res;
}

std::vector<double> CPlot::GetZValues() const
{
	std::vector<double> res;
	res.reserve(m_curves.size());
	for (const auto& curve : m_curves)
		res.push_back(curve->GetZValue());
	return res;
}

bool CPlot::Is2D() const
{
	const auto zValues = GetZValues();
	if (zValues.empty()) return true;
	if (zValues.size() == 1 && zValues.front() != 0.0) return false;
	// check that all z values are the same
	return std::adjacent_find(zValues.begin(), zValues.end(), std::not_equal_to<>()) == zValues.end();
}

size_t CPlot::GetCurvesNumber() const
{
	return m_curves.size();
}

void CPlot::ClearData()
{
	m_curves.clear();
}

void CPlot::Clear()
{
	ClearData();
	m_name = {};
	m_labelX = {};
	m_labelY = {};
	m_labelZ = {};
}

void CPlot::SaveToFile(CH5Handler& _h5File, const std::string& _path) const
{
	if (!_h5File.IsValid()) return;

	// current version of save procedure
	_h5File.WriteAttribute(_path, StrConst::H5AttrSaveVersion, m_saveVersion);

	_h5File.WriteData(_path, StrConst::PlotMngr_H5PlotName,  m_name);
	_h5File.WriteData(_path, StrConst::PlotMngr_H5PlotXAxis, m_labelX);
	_h5File.WriteData(_path, StrConst::PlotMngr_H5PlotYAxis, m_labelY);
	_h5File.WriteData(_path, StrConst::PlotMngr_H5PlotZAxis, m_labelZ);

	_h5File.WriteAttribute(_path, StrConst::PlotMngr_H5AttrCurvesNum, static_cast<int>(m_curves.size()));
	const std::string curvesGroup = _h5File.CreateGroup(_path, StrConst::PlotMngr_H5GroupCurves);
	for (size_t i = 0; i < m_curves.size(); ++i)
	{
		const std::string curvePath = _h5File.CreateGroup(curvesGroup, StrConst::PlotMngr_H5GroupCurveName + std::to_string(i));
		m_curves[i]->SaveToFile(_h5File, curvePath);
	}
}

void CPlot::LoadFromFile(CH5Handler& _h5File, const std::string& _path)
{
	Clear();

	if (!_h5File.IsValid()) return;

	// current version of save procedure
	//const int version = _h5File.ReadAttribute(_path, StrConst::H5AttrSaveVersion);

	_h5File.ReadData(_path, StrConst::PlotMngr_H5PlotName,  m_name);
	_h5File.ReadData(_path, StrConst::PlotMngr_H5PlotXAxis, m_labelX);
	_h5File.ReadData(_path, StrConst::PlotMngr_H5PlotYAxis, m_labelY);
	_h5File.ReadData(_path, StrConst::PlotMngr_H5PlotZAxis, m_labelZ);

	const size_t nCurves = _h5File.ReadAttribute(_path, StrConst::PlotMngr_H5AttrCurvesNum);
	const std::string curvesGroup = _path + "/" + StrConst::PlotMngr_H5GroupCurves;
	for (size_t i = 0; i < nCurves; ++i)
	{
		const std::string curvePath = curvesGroup + "/" + StrConst::PlotMngr_H5GroupCurveName + std::to_string(i);
		AddCurve("")->LoadFromFile(_h5File, curvePath);
	}
}

CCurve* CPlot::AddEmptyCurve(double _z)
{
	std::string name = StringFunctions::Double2String(_z);
	auto* curve = AddCurve(name);
	if (!curve && !GetCurve(_z)) // name clash because of low double-to-string precision
	{
		// try to increase precision
		for (size_t precision = std::cout.precision() + 1; precision < 30 && !curve; ++precision)
		{
			name = StringFunctions::Double2String(_z, precision);
			curve = AddCurve(name);
		}
	}
	if (curve) curve->SetZValue(_z);
	if (curve) curve->SetName(name);
	return curve;
}

////////////////////////////////////////////////////////////////////////////////
// CPlotManager
//

CPlotManager::CPlotManager(const CPlotManager& _other)
	: m_plots{ DeepCopy(_other.m_plots) }
	, m_plotsStored{ DeepCopy(_other.m_plotsStored) }
{
}

CPlotManager::CPlotManager(CPlotManager&& _other) noexcept
{
	swap(*this, _other);
}

CPlotManager& CPlotManager::operator=(CPlotManager _other)
{
	swap(*this, _other);
	return *this;
}

CPlotManager& CPlotManager::operator=(CPlotManager&& _other) noexcept
{
	CPlotManager tmp{ std::move(_other) };
	swap(*this, tmp);
	return *this;
}

void swap(CPlotManager& _first, CPlotManager& _second) noexcept
{
	using std::swap;
	swap(_first.m_plots      , _second.m_plots);
	swap(_first.m_plotsStored, _second.m_plotsStored);
}

CPlot* CPlotManager::AddPlot(const std::string& _name)
{
	if (GetPlot(_name)) return nullptr;
	m_plots.emplace_back(new CPlot{ _name });
	return m_plots.back().get();
}

CPlot* CPlotManager::AddPlot(const std::string& _name, const std::string& _labelX, const std::string& _labelY)
{
	if (GetPlot(_name)) return nullptr;
	m_plots.emplace_back(new CPlot{ _name, _labelX, _labelY });
	return m_plots.back().get();
}

CPlot* CPlotManager::AddPlot(const std::string& _name, const std::string& _labelX, const std::string& _labelY, const std::string& _labelZ)
{
	if (GetPlot(_name)) return nullptr;
	m_plots.emplace_back(new CPlot{ _name, _labelX, _labelY, _labelZ });
	return m_plots.back().get();
}

const CPlot* CPlotManager::GetPlot(size_t _index) const
{
	if (_index >= m_plots.size()) return {};
	return m_plots[_index].get();
}

CPlot* CPlotManager::GetPlot(size_t _index)
{
	return const_cast<CPlot*>(static_cast<const CPlotManager&>(*this).GetPlot(_index));
}

const CPlot* CPlotManager::GetPlot(const std::string& _name) const
{
	for (const auto& plot : m_plots)
		if (plot->GetName() == _name)
			return plot.get();
	return nullptr;
}

CPlot* CPlotManager::GetPlot(const std::string& _name)
{
	return const_cast<CPlot*>(static_cast<const CPlotManager&>(*this).GetPlot(_name));
}

void CPlotManager::RemovePlot(const std::string& _name)
{
	VectorDelete(m_plots, [&](const std::unique_ptr<CPlot>& s) { return s->GetName() == _name; });
}

std::vector<const CPlot*> CPlotManager::GetAllPlots() const
{
	std::vector<const CPlot*> res;
	res.reserve(m_plots.size());
	for (const auto& plot : m_plots)
		res.push_back(plot.get());
	return res;
}

std::vector<CPlot*> CPlotManager::GetAllPlots()
{
	std::vector<CPlot*> res;
	res.reserve(m_plots.size());
	for (const auto& plot : m_plots)
		res.push_back(plot.get());
	return res;
}

size_t CPlotManager::GetPlotsNumber() const
{
	return m_plots.size();
}

void CPlotManager::ClearData()
{
	m_plots.clear();
}

void CPlotManager::Clear()
{
	ClearData();
	m_plotsStored.clear();
}

void CPlotManager::SaveState()
{
	ResizeUniquePtrVector(m_plotsStored, m_plots.size());
	for (size_t i = 0; i < m_plots.size(); ++i)
		*m_plotsStored[i] = *m_plots[i];
}

void CPlotManager::LoadState()
{
	ResizeUniquePtrVector(m_plots, m_plotsStored.size());
	for (size_t i = 0; i < m_plotsStored.size(); ++i)
		*m_plots[i] = *m_plotsStored[i];
}

void CPlotManager::SaveToFile(CH5Handler& _h5File, const std::string& _path) const
{
	if (!_h5File.IsValid()) return;

	// current version of save procedure
	_h5File.WriteAttribute(_path, StrConst::H5AttrSaveVersion, m_saveVersion);

	_h5File.WriteAttribute(_path, StrConst::PlotMngr_H5AttrPlotsNum, static_cast<int>(m_plots.size()));
	for (size_t i = 0; i < m_plots.size(); ++i)
	{
		const std::string plotPath = _h5File.CreateGroup(_path, StrConst::PlotMngr_H5GroupPlotName + std::to_string(i));
		m_plots[i]->SaveToFile(_h5File, plotPath);
	}
}

void CPlotManager::LoadFromFile(CH5Handler& _h5File, const std::string& _path)
{
	Clear();

	if (!_h5File.IsValid()) return;

	// current version of save procedure
	//const int version = _h5File.ReadAttribute(_path, StrConst::H5AttrSaveVersion);

	const size_t nPlots = _h5File.ReadAttribute(_path, StrConst::PlotMngr_H5AttrPlotsNum);
	for (size_t i = 0; i < nPlots; ++i)
	{
		const std::string plotPath = _path + "/" + StrConst::PlotMngr_H5GroupPlotName + std::to_string(i);
		AddPlot("")->LoadFromFile(_h5File, plotPath);
	}
}

void CPlotManager::LoadFromFile_v0(const CH5Handler& _h5File, const std::string& _path)
{
	Clear();

	if (!_h5File.IsValid()) return;

	const size_t nPlots = _h5File.ReadAttribute(_path, StrConst::PlotMngr_H5AttrPlotsNum);
	if (nPlots == static_cast<size_t>(-1)) return;
	const std::string plotsPath = _path + "/" + StrConst::BUnit_H5GroupPlots + "/" + StrConst::PlotMngr_H5GroupPlotName;
	for (size_t i = 0; i < nPlots; ++i)
	{
		const std::string plotPath = plotsPath + std::to_string(i);
		auto* plot = AddPlot("");
		std::string plotName;
		_h5File.ReadData(plotPath, StrConst::BUnit_H5PlotName, plotName);
		plot->SetName(plotName);
		std::string axisX, axisY, axisZ;
		_h5File.ReadData(plotPath, StrConst::BUnit_H5PlotXAxis, axisX);
		_h5File.ReadData(plotPath, StrConst::BUnit_H5PlotYAxis, axisY);
		_h5File.ReadData(plotPath, StrConst::BUnit_H5PlotZAxis, axisZ);
		plot->SetLabels(axisX, axisY, axisZ);

		const size_t nCurves = _h5File.ReadAttribute(plotPath, StrConst::BUnit_H5AttrCurvesNum);
		if (nCurves == static_cast<size_t>(-1)) continue;
		std::string curvesPath = plotPath + "/" + StrConst::BUnit_H5GroupCurves + "/" + StrConst::BUnit_H5GroupCurveName;
		for (size_t j = 0; j < static_cast<size_t>(nCurves); ++j)
		{
			std::string curvePath = curvesPath + std::to_string(j);
			auto* curve = plot->AddCurve("");
			std::string curveName;
			_h5File.ReadData(curvePath, StrConst::BUnit_H5CurveName, curveName);
			curve->SetName(curveName);
			std::vector<double> x, y;
			_h5File.ReadData(curvePath, StrConst::BUnit_H5CurveX, x);
			_h5File.ReadData(curvePath, StrConst::BUnit_H5CurveY, y);
			curve->AddPoints(x, y);
			double valueZ;
			_h5File.ReadData(curvePath, StrConst::BUnit_H5CurveZ, valueZ);
			curve->SetZValue(valueZ);
		}
	}
}