#5615 GOCAD : Fix sign of z-value of imported vertex data

This commit is contained in:
Magne Sjaastad 2020-02-28 14:30:30 +01:00
parent 0cd0c7d80d
commit ff2e757789

View File

@ -51,7 +51,9 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceReader::read
{
std::ifstream stream( filename.toLatin1().data() );
bool isInTfaceSection = false;
bool isInTfaceSection = false;
GocadZPositive zDir = GocadZPositive::Unknown;
while ( stream.good() )
{
std::string line;
@ -61,8 +63,6 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceReader::read
std::istringstream lineStream( line );
GocadZPositive zDir = GocadZPositive::Unknown;
std::string firstToken;
lineStream >> firstToken;
@ -82,7 +82,10 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceReader::read
if ( vertexId > -1 )
{
if ( zDir == GocadZPositive::Elevation ) z = -z;
if ( zDir == GocadZPositive::Depth )
{
z = -z;
}
vertices.emplace_back( cvf::Vec3d( x, y, z ) );
vertexIdToIndex[vertexId] = static_cast<unsigned>( vertices.size() - 1 );