IlvBoolean ColorLineRenderer::isPersistent() { return IlvTrue; } void ColorLineRenderer::write(IlvOutputFile& output) const { IlvWriteString(output, _attributeName); if(_colorModel->isPersistent()) { output.getStream() << 1 << IlvSpc(); _colorModel->write(output); } else { output.getStream() << 1 << IlvSpc(); IlvWarning("colormodel not saved"); } } |
ColorLineRenderer::ColorLineRenderer(IlvInputFile& stream) :IlvFeatureRenderer(stream.getDisplay(), IlvTrue) { char* s = IlvReadString(stream); if(s) _attributeName = strcpy(new char[strlen(s)+1], s); IlvInt hasColorModel; stream.getStream() >> hasColorModel; if(hasColorModel) { _colorModel = (IlvMapColorModel*) IlvMapClassInfo::ReadObject(IlvMapColorModel::ClassInfo(), stream, 0); } else { _colorModel = IlvIntervalColorModel::MakeElevationColorModel(); } } |