MPQC  3.0.0-alpha
object.h
1 //
2 // object.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _util_render_object_h
29 #define _util_render_object_h
30 
31 #include <iostream>
32 
33 #include <util/keyval/keyval.h>
34 #include <util/render/material.h>
35 #include <util/render/appearance.h>
36 #include <util/render/transform.h>
37 
38 namespace sc {
39 
40 class Render;
41 
43  protected:
44  std::string name_;
45  Ref<Material> material_;
46  Ref<Appearance> appearance_;
47  Ref<Transform> transform_;
48 
49  friend class Render;
50  public:
51  RenderedObject(const Ref<Material>& = 0);
53  ~RenderedObject();
54  const char* name() const { return name_.c_str(); }
55  void set_name(const char *);
56  Ref<Material> material() const { return material_; }
57  Ref<Appearance> appearance() const { return appearance_; }
58  Ref<Transform> transform() const { return transform_; }
59  void material(const Ref<Material>&m) { material_ = m; }
60  void appearance(const Ref<Appearance>&a) { appearance_ = a; }
61  void transform(const Ref<Transform>&t) { transform_ = t; }
62 
63  virtual void print(std::ostream& = ExEnv::out0()) const;
64 
65  // to be called only by derivatives of Render
66  virtual void render(const Ref<Render>&) = 0;
67 };
68 
69 
71  private:
72  int capacity_;
73  int n_;
74  Ref<RenderedObject> *array_;
75  protected:
76  void render(const Ref<Render>&);
77  public:
78  RenderedObjectSet(int capacity = 10);
81  int n() const { return n_; }
82  const Ref<RenderedObject>& element(int i) const { return array_[i]; }
83  virtual void add(const Ref<RenderedObject>&);
84 };
85 
86 }
87 
88 #endif
89 
90 // Local Variables:
91 // mode: c++
92 // c-file-style: "CLJ"
93 // End:
sc::RenderedObjectSet
Definition: object.h:70
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::RenderedObject
Definition: object.h:42
sc::RenderedObject::print
virtual void print(std::ostream &=ExEnv::out0()) const
Print the object.
sc::Render
Definition: render.h:46
sc::DescribedClass
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition: class.h:233
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::transform
RefSCMatrix transform(const OrbitalSpace &space2, const OrbitalSpace &space1, const Ref< SCMatrixKit > &kit=SCMatrixKit::default_matrixkit())
transform(s2,s1) returns matrix that transforms s1 to s2.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:24:02 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.