Commit 743a68ef authored by Ken Martin's avatar Ken Martin
Browse files

new organization of dependency

parent 75e45c9a
......@@ -53,27 +53,6 @@ void vlDataSetToDataSetFilter::Initialize()
}
}
vlMapper *vlDataSetToDataSetFilter::MakeMapper()
{
//
// A little tricky because mappers must be of concrete type, but this class
// deals at abstract level of DataSet. Depending upon Input member of this
// filter, mapper may change. Hence need to anticipate change in Input and
// create new mappers as necessary.
//
vlMapper *mapper;
vlDataSetToDataSetFilter::Update(); // compiler bug, had to hard code call
mapper = this->DataSet->MakeMapper();
if ( !this->Mapper || mapper != this->Mapper )
{
if (this->Mapper) this->Mapper->UnRegister(this);
this->Mapper = mapper;
this->Mapper->Register(this);
}
return this->Mapper;
}
void vlDataSetToDataSetFilter::PrintSelf(ostream& os, vlIndent indent)
{
if (this->ShouldIPrint(vlDataSetToDataSetFilter::GetClassName()))
......
......@@ -17,6 +17,9 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// Methods for polygon mapper
//
#include "DSMapper.hh"
#include "PolyMap.hh"
#include "UGridMap.hh"
#include "UPtsMap.hh"
vlDataSetMapper::vlDataSetMapper()
{
......@@ -92,19 +95,61 @@ void vlDataSetMapper::Render(vlRenderer *ren)
int vlDataSetMapper::CreateMapper()
{
vlMapper *mapper;
char *InputType;
char *OldMapperType = NULL;
if ( !(mapper = this->Input->MakeMapper()) )
InputType = this->Input->GetDataType();
// if we have an old mapper get its type otherwise set it to none
if (this->Mapper)
{
OldMapperType = this->Mapper->GetClassName();
}
else
{
OldMapperType = "none";
}
if (!strcmp("vlPolyData",InputType))
{
if (strcmp(OldMapperType,"vlPolyMapper"))
{
if (this->Mapper) this->Mapper->UnRegister(this);
this->Mapper = new vlPolyMapper;
this->Mapper->Register(this);
}
}
if (!strcmp("vlStructuredPoints",InputType))
{
vlErrorMacro(<< "Cannot map type: " << this->Input->GetClassName() <<"\n");
return 0;
vlErrorMacro(<< "Structured Points Mapper not supported");
}
if ( mapper != this->Mapper )
if (!strcmp("vlStructuredGrid",InputType))
{
*mapper = *this; // Update lookup table, etc.
if (this->Mapper) this->Mapper->UnRegister(this);
this->Mapper = mapper;
this->Mapper->Register(this);
vlErrorMacro(<< "Structured Grid Mapper not supported");
}
if (!strcmp("vlUnstructuredGrid",InputType))
{
if (strcmp(OldMapperType,"vlUnstructuredGridMapper"))
{
if (this->Mapper) this->Mapper->UnRegister(this);
this->Mapper = new vlUnstructuredGridMapper;
this->Mapper->Register(this);
}
}
if (!strcmp("vlUnstructuredPoints",InputType))
{
if (strcmp(OldMapperType,"vlUnstructuredPointsMapper"))
{
if (this->Mapper) this->Mapper->UnRegister(this);
this->Mapper = new vlUnstructuredPointsMapper;
this->Mapper->Register(this);
}
}
return 1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment