00001 /*
00002 File: RadScene.cc
00003
00004 Function: See header file
00005
00006 Author(s): Andrew Willmott
00007
00008 Copyright: (c) 1997-2000, Andrew Willmott
00009
00010 */
00011
00012 #include "RadScene.h"
00013 #include "RadMethod.h"
00014
00015 // --- scRadMesh class ----------------------------------------------------------
00016
00017
00018 Void scRadMesh::Draw(Renderer &r, SLContext *context)
00019 {
00020 rad->Draw(r);
00021 }
00022
00023
00024 Void scRadMesh::Parse(istream &s)
00025 {
00026 String str;
00027
00028 str.ReadWord(s);
00029
00030 delete rad;
00031 rad = 0;
00032 // XXX get register working or redo!!!
00033
00034 if (rad)
00035 rad->Parse(s);
00036 else
00037 {
00038 cerr << "*** mesh: unknown algorithm type: " << str << endl;
00039
00040 do
00041 {
00042 str.ReadLine(s);
00043 str.ReadWord(s);
00044 }
00045 while (str != "end");
00046 }
00047 }
00048
00049 Void scRadMesh::Print(ostream &s) const
00050 {
00051 Int i;
00052 s << "mesh ";
00053
00054 if (rad)
00055 rad->Print(s);
00056 else
00057 s << "null";
00058 s << endl << "end";
00059 }
00060
00061
00062 // --- Matrix display pane ----------------------------------------------------
00063
00064
00065 StrConst scMatrixDisplay::Label() const
00066 {
00067 return("Matrix Display");
00068 }
00069
00070 #define MAT_OUTLINE
00071
00072 Void scMatrixDisplay::Draw(Renderer &r, SLContext *context)
00073 {
00074 #ifdef MAT_OUTLINE
00075 r
00076 .C(cWhite)
00077 .Begin(renLineLoop)
00078 .P(Point(-1, -1, 0))
00079 .P(Point(1, -1, 0))
00080 .P(Point(1, 1, 0))
00081 .P(Point(-1, 1, 0))
00082 .End();
00083 #endif
00084 if (method && *method)
00085 ((RadMethod *)(*method))->DrawMatrix(r);
00086 else
00087 _Error("no rad method set.");
00088 }