mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -3,35 +3,35 @@
|
||||
// Copyright (C) Statoil ASA
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
// Copyright (C) 2011-2012 Ceetron AS
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "cvfArray.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace cvf {
|
||||
class DrawableGeo;
|
||||
class ScalarMapper;
|
||||
}
|
||||
namespace cvf
|
||||
{
|
||||
class DrawableGeo;
|
||||
class ScalarMapper;
|
||||
} // namespace cvf
|
||||
|
||||
class RivObjectSourceInfo;
|
||||
|
||||
@@ -42,70 +42,84 @@ public:
|
||||
~RivPipeGeometryGenerator() override;
|
||||
|
||||
// Coordinates and orientations
|
||||
void setPipeCenterCoords(const cvf::Vec3dArray* coords);
|
||||
|
||||
void setPipeCenterCoords( const cvf::Vec3dArray* coords );
|
||||
|
||||
// Appearance
|
||||
void setRadius(double radius);
|
||||
void setCrossSectionVertexCount(size_t vertexCount);
|
||||
void setRadius( double radius );
|
||||
void setCrossSectionVertexCount( size_t vertexCount );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> createPipeSurface();
|
||||
cvf::ref<cvf::DrawableGeo> createCenterLine();
|
||||
|
||||
void pipeSurfaceTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector<double>& segmentResults, const cvf::ScalarMapper* mapper) const;
|
||||
void centerlineTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector<double>& segmentResults, const cvf::ScalarMapper* mapper) const;
|
||||
void pipeSurfaceTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<double>& segmentResults,
|
||||
const cvf::ScalarMapper* mapper ) const;
|
||||
void centerlineTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<double>& segmentResults,
|
||||
const cvf::ScalarMapper* mapper ) const;
|
||||
|
||||
void setFirstVisibleSegmentIndex(size_t segmentIndex);
|
||||
size_t segmentIndexFromTriangleIndex(size_t triangleIndex) const;
|
||||
void setFirstVisibleSegmentIndex( size_t segmentIndex );
|
||||
size_t segmentIndexFromTriangleIndex( size_t triangleIndex ) const;
|
||||
|
||||
void cylinderWithCenterLineParts(cvf::Collection<cvf::Part>* destinationParts,
|
||||
const std::vector<cvf::Vec3d>& centerCoords,
|
||||
const cvf::Color3f& color,
|
||||
double radius);
|
||||
void cylinderWithCenterLineParts( cvf::Collection<cvf::Part>* destinationParts,
|
||||
const std::vector<cvf::Vec3d>& centerCoords,
|
||||
const cvf::Color3f& color,
|
||||
double radius );
|
||||
|
||||
void tubeWithCenterLinePartsAndVariableWidth(cvf::Collection<cvf::Part>* destinationParts,
|
||||
const std::vector<cvf::Vec3d>& centerCoords,
|
||||
const std::vector<double>& radii,
|
||||
const cvf::Color3f& color);
|
||||
void tubeWithCenterLinePartsAndVariableWidth( cvf::Collection<cvf::Part>* destinationParts,
|
||||
const std::vector<cvf::Vec3d>& centerCoords,
|
||||
const std::vector<double>& radii,
|
||||
const cvf::Color3f& color );
|
||||
|
||||
private:
|
||||
void clearComputedData();
|
||||
void updateFilteredPipeCenterCoords();
|
||||
|
||||
size_t findFirstSegmentWithLength(double squareDistanceTolerance);
|
||||
size_t findFirstSegmentWithLength( double squareDistanceTolerance );
|
||||
|
||||
static void computeCircle(double radius, size_t tesselationCount, const cvf::Vec3d& center, const cvf::Vec3d& orient1, const cvf::Vec3d& orient2, std::vector<cvf::Vec3d>* nodes);
|
||||
static void computeCircle( double radius,
|
||||
size_t tesselationCount,
|
||||
const cvf::Vec3d& center,
|
||||
const cvf::Vec3d& orient1,
|
||||
const cvf::Vec3d& orient2,
|
||||
std::vector<cvf::Vec3d>* nodes );
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> generateLine(const cvf::Vec3dArray* coords);
|
||||
static cvf::ref<cvf::DrawableGeo> generateExtrudedCylinder(double radius, size_t crossSectionNodeCount,const cvf::Vec3dArray* cylinderCenterCoords);
|
||||
static cvf::ref<cvf::DrawableGeo> generateVariableRadiusTube(size_t crossSectionNodeCount, const cvf::Vec3dArray* cylinderCenterCoords, const std::vector<double>& radii);
|
||||
static cvf::ref<cvf::DrawableGeo> generateLine( const cvf::Vec3dArray* coords );
|
||||
static cvf::ref<cvf::DrawableGeo> generateExtrudedCylinder( double radius,
|
||||
size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords );
|
||||
static cvf::ref<cvf::DrawableGeo> generateVariableRadiusTube( size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords,
|
||||
const std::vector<double>& radii );
|
||||
|
||||
static void computeExtrudedCoordsAndNormals( cvf::Vec3d intersectionCoord,
|
||||
cvf::Vec3d intersectionPlaneNormal,
|
||||
cvf::Vec3d segmentDirection,
|
||||
size_t crossSectionNodeCount,
|
||||
std::vector<cvf::Vec3d>* extrudedNodes,
|
||||
std::vector<cvf::Vec3f>* crossSectionVertices,
|
||||
std::vector<cvf::Vec3f>* cylinderSegmentNormals );
|
||||
|
||||
static void computeExtrudedCoordsAndNormals(cvf::Vec3d intersectionCoord,
|
||||
cvf::Vec3d intersectionPlaneNormal,
|
||||
cvf::Vec3d segmentDirection,
|
||||
size_t crossSectionNodeCount,
|
||||
std::vector<cvf::Vec3d>* extrudedNodes,
|
||||
std::vector<cvf::Vec3f>* crossSectionVertices,
|
||||
std::vector<cvf::Vec3f>* cylinderSegmentNormals);
|
||||
private:
|
||||
cvf::cref<cvf::Vec3dArray> m_originalPipeCenterCoords;
|
||||
|
||||
cvf::cref<cvf::Vec3dArray> m_originalPipeCenterCoords;
|
||||
|
||||
// Based on m_originalPipeCenterCoords, produce list of coords where coords at the same location is removed
|
||||
// When a bend is detected, extra bend coordinates are inserted
|
||||
std::vector<cvf::Vec3d> m_filteredPipeCenterCoords;
|
||||
|
||||
std::vector<cvf::Vec3d> m_filteredPipeCenterCoords;
|
||||
|
||||
// Map from generated cylinder segments to pipe result indices
|
||||
std::vector<size_t> m_filteredPipeSegmentToResult;
|
||||
std::vector<size_t> m_filteredPipeSegmentToResult;
|
||||
|
||||
size_t m_firstVisibleSegmentIndex;
|
||||
size_t m_firstVisibleSegmentIndex;
|
||||
|
||||
double m_radius;
|
||||
double m_radius;
|
||||
|
||||
// Pipe bends with a opening angle below given angle is modified with extra bend coordinates
|
||||
double m_minimumBendAngle;
|
||||
double m_minimumBendAngle;
|
||||
|
||||
// Scaling factor used to control how far from original pipe position the extra bend coordinates are located
|
||||
// This will affect how sharp or smooth bend will appear
|
||||
double m_bendScalingFactor;
|
||||
double m_bendScalingFactor;
|
||||
|
||||
size_t m_crossSectionNodeCount;
|
||||
size_t m_crossSectionNodeCount;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user