| 60 | } |
| 61 | |
| 62 | void vtkRIBProperty::AddVariable(const char* variable, const char* value) |
| 63 | { |
| 64 | if (this->Declarations == nullptr) |
| 65 | { |
| 66 | this->SetVariable(variable, value); |
| 67 | } |
| 68 | else |
| 69 | { |
| 70 | auto newVariable = vtk::format("Declare \"{}\" \"{}\"\n", variable, value); |
| 71 | char* oldDeclarations = this->Declarations; |
| 72 | |
| 73 | this->Declarations = new char[strlen(oldDeclarations) + newVariable.size() + 1]; |
| 74 | strcpy(this->Declarations, oldDeclarations); |
| 75 | strcat(this->Declarations, newVariable.c_str()); |
| 76 | delete[] oldDeclarations; |
| 77 | this->Modified(); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | void vtkRIBProperty::SetParameter(const char* parameter, const char* value) |
| 82 | { |