Changeset 3316 for branches


Ignore:
Timestamp:
Feb 21, 2013 8:03:33 PM (11 years ago)
Author:
ldelgass
Message:

Cutplane fixes: use outline where cutplane intersects data set bounding box
rather than tight outline around geometry resulting from cut, which may be empty
(e.g. for a 3D Delaunay triangulation of a point cloud).

Location:
branches/Rappture 1.2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/Rappture 1.2/gui/scripts/vtkisosurfaceviewer.tcl

    r3311 r3316  
    21002100    $itk_component(xbutton) select
    21012101    itk_component add xposition {
    2102         ::scale $inner.xval -from 100 -to 1 \
     2102        ::scale $inner.xval -from 100 -to 0 \
    21032103            -width 10 -orient vertical -showvalue yes \
    21042104            -borderwidth 1 -highlightthickness 0 \
     
    21292129
    21302130    itk_component add yposition {
    2131         ::scale $inner.yval -from 100 -to 1 \
     2131        ::scale $inner.yval -from 100 -to 0 \
    21322132            -width 10 -orient vertical -showvalue yes \
    21332133            -borderwidth 1 -highlightthickness 0 \
     
    21612161
    21622162    itk_component add zposition {
    2163         ::scale $inner.zval -from 100 -to 1 \
     2163        ::scale $inner.zval -from 100 -to 0 \
    21642164            -width 10 -orient vertical -showvalue yes \
    21652165            -borderwidth 1 -highlightthickness 0 \
  • branches/Rappture 1.2/gui/scripts/vtkstreamlinesviewer.tcl

    r3311 r3316  
    23062306
    23072307    itk_component add xCutScale {
    2308         ::scale $inner.xval -from 100 -to 1 \
     2308        ::scale $inner.xval -from 100 -to 0 \
    23092309            -width 10 -orient vertical -showvalue yes \
    23102310            -borderwidth 1 -highlightthickness 0 \
     
    23352335
    23362336    itk_component add yCutScale {
    2337         ::scale $inner.yval -from 100 -to 1 \
     2337        ::scale $inner.yval -from 100 -to 0 \
    23382338            -width 10 -orient vertical -showvalue yes \
    23392339            -borderwidth 1 -highlightthickness 0 \
     
    23642364
    23652365    itk_component add zCutScale {
    2366         ::scale $inner.zval -from 100 -to 1 \
     2366        ::scale $inner.zval -from 100 -to 0 \
    23672367            -width 10 -orient vertical -showvalue yes \
    23682368            -borderwidth 1 -highlightthickness 0 \
  • branches/Rappture 1.2/gui/scripts/vtkviewer.tcl

    r3311 r3316  
    21022102
    21032103    itk_component add xCutScale {
    2104         ::scale $inner.xval -from 100 -to 1 \
     2104        ::scale $inner.xval -from 100 -to 0 \
    21052105            -width 10 -orient vertical -showvalue yes \
    21062106            -borderwidth 1 -highlightthickness 0 \
     
    21422142
    21432143    itk_component add yCutScale {
    2144         ::scale $inner.yval -from 100 -to 1 \
     2144        ::scale $inner.yval -from 100 -to 0 \
    21452145            -width 10 -orient vertical -showvalue yes \
    21462146            -borderwidth 1 -highlightthickness 0 \
     
    21822182
    21832183    itk_component add zCutScale {
    2184         ::scale $inner.zval -from 100 -to 1 \
     2184        ::scale $inner.zval -from 100 -to 0 \
    21852185            -width 10 -orient vertical -showvalue yes \
    21862186            -borderwidth 1 -highlightthickness 0 \
  • branches/Rappture 1.2/gui/scripts/vtkvolumeviewer.tcl

    r3311 r3316  
    21712171
    21722172    itk_component add xCutScale {
    2173         ::scale $inner.xval -from 100 -to 1 \
     2173        ::scale $inner.xval -from 100 -to 0 \
    21742174            -width 10 -orient vertical -showvalue yes \
    21752175            -borderwidth 1 -highlightthickness 0 \
     
    21982198
    21992199    itk_component add yCutScale {
    2200         ::scale $inner.yval -from 100 -to 1 \
     2200        ::scale $inner.yval -from 100 -to 0 \
    22012201            -width 10 -orient vertical -showvalue yes \
    22022202            -borderwidth 1 -highlightthickness 0 \
     
    22252225
    22262226    itk_component add zCutScale {
    2227         ::scale $inner.zval -from 100 -to 1 \
     2227        ::scale $inner.zval -from 100 -to 0 \
    22282228            -width 10 -orient vertical -showvalue yes \
    22292229            -borderwidth 1 -highlightthickness 0 \
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.cpp

    r3273 r3316  
    350350        if (_mapper[i] != NULL) {
    351351            _borderMapper[i] = vtkSmartPointer<vtkPolyDataMapper>::New();
     352#ifdef CUTPLANE_TIGHT_OUTLINE
    352353            _outlineFilter[i] = vtkSmartPointer<vtkOutlineFilter>::New();
    353354            _outlineFilter[i]->SetInputConnection(_mapper[i]->GetInputConnection(0, 0));
    354355            _borderMapper[i]->SetInputConnection(_outlineFilter[i]->GetOutputPort());
     356#else
     357            _outlineSource[i] = vtkSmartPointer<vtkOutlineSource>::New();
     358            switch (i) {
     359            case 0:
     360                _outlineSource[i]->SetBounds(bounds[0] + (bounds[1]-bounds[0])/2.,
     361                                             bounds[0] + (bounds[1]-bounds[0])/2.,
     362                                             bounds[2], bounds[3],
     363                                             bounds[4], bounds[5]);
     364                break;
     365            case 1:
     366                _outlineSource[i]->SetBounds(bounds[0], bounds[1],
     367                                             bounds[2] + (bounds[3]-bounds[2])/2.,
     368                                             bounds[2] + (bounds[3]-bounds[2])/2.,
     369                                             bounds[4], bounds[5]);
     370                break;
     371            case 2:
     372                _outlineSource[i]->SetBounds(bounds[0], bounds[1],
     373                                             bounds[2], bounds[3],
     374                                             bounds[4] + (bounds[5]-bounds[4])/2.,
     375                                             bounds[4] + (bounds[5]-bounds[4])/2.);
     376                break;
     377            default:
     378                ;
     379            }
     380            _borderMapper[i]->SetInputConnection(_outlineSource[i]->GetOutputPort());
     381#endif
    355382            _borderMapper[i]->SetResolveCoincidentTopologyToPolygonOffset();
    356383        }
     
    406433    double bounds[6];
    407434    _dataSet->getBounds(bounds);
     435#if 0
     436    if (ratio == 0.0)
     437        ratio = 0.001;
     438    if (ratio == 1.0)
     439        ratio = 0.999;
     440#endif
    408441    switch (axis) {
    409442    case X_AXIS:
     
    411444                                0,
    412445                                0);
     446#ifndef CUTPLANE_TIGHT_OUTLINE
     447        _outlineSource[0]->SetBounds(bounds[0] + (bounds[1]-bounds[0]) * ratio,
     448                                     bounds[0] + (bounds[1]-bounds[0]) * ratio,
     449                                     bounds[2], bounds[3],
     450                                     bounds[4], bounds[5]);
     451#endif
    413452        if (_mapper[0] != NULL)
    414453            _mapper[0]->Update();
     
    418457                                bounds[2] + (bounds[3]-bounds[2]) * ratio,
    419458                                0);
     459#ifndef CUTPLANE_TIGHT_OUTLINE
     460        _outlineSource[1]->SetBounds(bounds[0], bounds[1],
     461                                     bounds[2] + (bounds[3]-bounds[2]) * ratio,
     462                                     bounds[2] + (bounds[3]-bounds[2]) * ratio,
     463                                     bounds[4], bounds[5]);
     464#endif
    420465        if (_mapper[1] != NULL)
    421466            _mapper[1]->Update();
     
    425470                                0,
    426471                                bounds[4] + (bounds[5]-bounds[4]) * ratio);
     472#ifndef CUTPLANE_TIGHT_OUTLINE
     473        _outlineSource[2]->SetBounds(bounds[0], bounds[1],
     474                                     bounds[2], bounds[3],
     475                                     bounds[4] + (bounds[5]-bounds[4]) * ratio,
     476                                     bounds[4] + (bounds[5]-bounds[4]) * ratio);
     477#endif
    427478        if (_mapper[2] != NULL)
    428479            _mapper[2]->Update();
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.h

    r3211 r3316  
    1717#include <vtkPlane.h>
    1818#include <vtkOutlineFilter.h>
     19#include <vtkOutlineSource.h>
    1920#include <vtkGaussianSplatter.h>
    2021
     
    2526namespace Rappture {
    2627namespace VtkVis {
     28
     29//#define CUTPLANE_TIGHT_OUTLINE
    2730
    2831/**
     
    110113    vtkSmartPointer<vtkCutter> _cutter[3];
    111114    vtkSmartPointer<vtkPlane> _cutPlane[3];
     115#ifdef CUTPLANE_TIGHT_OUTLINE
    112116    vtkSmartPointer<vtkOutlineFilter> _outlineFilter[3];
     117#else
     118    vtkSmartPointer<vtkOutlineSource> _outlineSource[3];
     119#endif
    113120    vtkSmartPointer<vtkGaussianSplatter> _splatter;
    114121};
Note: See TracChangeset for help on using the changeset viewer.