#1471 Completions visualization

This commit is contained in:
Bjørnar Grip Fjær
2017-05-10 17:10:23 +02:00
parent 15bac1b050
commit b81150829a
6 changed files with 87 additions and 47 deletions

View File

@@ -21,6 +21,8 @@
#include "RivPipeGeometryGenerator.h"
#include "RivObjectSourceInfo.h"
#include "cafEffectGenerator.h"
#include "cvfDrawableGeo.h"
#include "cvfPlane.h"
@@ -603,3 +605,43 @@ void RivPipeGeometryGenerator::setFirstSegmentIndex(size_t segmentIndex)
m_firstSegmentIndex = segmentIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivPipeGeometryGenerator::cylinderWithCenterLineParts(cvf::Collection<cvf::Part>* destinationParts, const std::vector<cvf::Vec3d>& centerCoords, const cvf::Color3f& color, double radius)
{
setRadius(radius);
setCrossSectionVertexCount(12);
cvf::ref<cvf::Vec3dArray> cvfCoords = new cvf::Vec3dArray(centerCoords);
setPipeCenterCoords(cvfCoords.p());
cvf::ref<cvf::DrawableGeo> surfaceGeo = createPipeSurface();
if (surfaceGeo.notNull())
{
cvf::Part* part = new cvf::Part;
part->setDrawable(surfaceGeo.p());
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1);
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
part->setEffect(eff.p());
destinationParts->push_back(part);
}
cvf::ref<cvf::DrawableGeo> centerLineGeo = createCenterLine();
if (centerLineGeo.notNull())
{
cvf::Part* part = new cvf::Part;
part->setDrawable(centerLineGeo.p());
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1);
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
part->setEffect(eff.p());
destinationParts->push_back(part);
}
}