mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3928 Coordinate transform : Add convert of vector of points
This commit is contained in:
@@ -45,10 +45,25 @@ cvf::Vec3d caf::DisplayCoordTransform::transformToDisplayCoord(const cvf::Vec3d&
|
||||
coord.x() *= m_scale.x();
|
||||
coord.y() *= m_scale.y();
|
||||
coord.z() *= m_scale.z();
|
||||
|
||||
|
||||
return coord;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d> caf::DisplayCoordTransform::transformToDisplayCoords(const std::vector<cvf::Vec3d>& domainCoords) const
|
||||
{
|
||||
std::vector<cvf::Vec3d> displayCoords;
|
||||
|
||||
for (const auto& coord : domainCoords)
|
||||
{
|
||||
displayCoords.emplace_back(transformToDisplayCoord(coord));
|
||||
}
|
||||
|
||||
return displayCoords;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
namespace caf {
|
||||
#include <vector>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
@@ -19,7 +21,9 @@ public:
|
||||
void setScale(const cvf::Vec3d& scale);
|
||||
void setTranslation(const cvf::Vec3d& translation);
|
||||
|
||||
cvf::Vec3d transformToDisplayCoord(const cvf::Vec3d& domainCoord) const;
|
||||
cvf::Vec3d transformToDisplayCoord(const cvf::Vec3d& domainCoord) const;
|
||||
std::vector<cvf::Vec3d> transformToDisplayCoords(const std::vector<cvf::Vec3d>& domainCoords) const;
|
||||
|
||||
cvf::Vec3d translateToDisplayCoord(const cvf::Vec3d& domainCoord) const;
|
||||
|
||||
cvf::Vec3d scaleToDisplaySize(const cvf::Vec3d& domainSize) const;
|
||||
@@ -33,4 +37,4 @@ private:
|
||||
cvf::Vec3d m_translation;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
Reference in New Issue
Block a user