Changeset 340

Show
Ignore:
Timestamp:
10/29/02 23:52:46 (6 years ago)
Author:
sholloway
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBRapier/RBRapier/Renderer/DisplayList.py

    r338 r340  
    2525 
    2626from OpenGL import GL 
     27from Foundation.AspectOriented import Aspect 
    2728import time 
    2829 
     
    3132#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3233 
    33 class DisplayList(object): 
     34class DisplayList(Aspect.Aspect): 
    3435    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3536    #~ Constants / Variables / Etc.  
    3637    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3738 
    38     Active = 1 
    39     RecreateCache = 1 
    40     ListId = None 
     39    __RecreateCache = 1 
     40    __ListId = None 
    4141 
    4242    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    4444    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4545 
    46     def __init__(self, CachedObj): 
    47         self.CachedObj = CachedObj 
    48  
    49     def Draw(self, context): 
    50         if not self.Active: return 
    51         if self.RecreateCache and self.CachedObj is not None: 
    52             if __debug__:  
    53                 print "Caching %r..." % self.CachedObj, 
     46    def Execute(self, context): 
     47        if self.__RecreateCache: 
     48            if __debug__: 
     49                print "Caching %r..." % self.__CachedObj, 
    5450                StartTime = time.clock() 
    55             if self.ListId is None: 
    56                 self.ListId = GL.glGenLists(1) 
    57             GL.glNewList(self.ListId, GL.GL_COMPILE) 
    58             self.CachedObj.Setup(context) 
    59             self.CachedObj.Draw(context) 
     51            if self.__ListId is None: 
     52                self.__ListId = GL.glGenLists(1) 
     53            GL.glNewList(self.__ListId, GL.GL_COMPILE) 
     54            super(DisplayList, self).Execute(context) 
    6055            GL.glEndList() 
    6156            if __debug__:  
    6257                EndTime = time.clock() 
    6358                print "Done (%1.4f)" % (EndTime-StartTime) 
    64             self.RecreateCache = 0 
     59            self.__RecreateCache = 0 
    6560 
    66         if self.ListId is not None: 
    67             GL.glCallList(self.ListId) 
     61        if self.__ListId is not None: 
     62            GL.glCallList(self.__ListId) 
    6863 
  • trunk/RBRapier/RBRapier/Renderer/Geometry/ArrayTraversal.py

    r338 r340  
    4242        self.rangecollection = rangecollection 
    4343 
    44     def Draw(self, context): 
     44    def Execute(self, context): 
    4545        for range in self.rangecollection: 
    4646            GL.glDrawArrays(self.primitive, range) 
     
    7272        self._glDrawElements = self._glDrawElementsCall[format]  
    7373 
    74     def Draw(self, context): 
     74    def Execute(self, context): 
    7575        for data in self.datacollection: 
    7676            self._glDrawElements(self.primitive, self.data) 
  • trunk/RBRapier/RBRapier/Renderer/Geometry/VertexArrays.py

    r338 r340  
    4949        self._glArrayPointer = self._glArrayPointers[format] 
    5050 
    51     def Select(self): 
     51    def Select(self, context): 
    5252        self._glArrayPointer(self.data) 
    53         GL.glEnableClientState(self._glArrayType) 
     53        context.ClientStateMgr.Enable(self._glArrayType) 
    5454 
    55     def Deselct(self): 
    56         GL.glDisableClientState(self._glArrayType) 
     55    def Deselct(self, context): 
     56        context.ClientStateMgr.Disable(self._glArrayType) 
    5757 
    5858#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBRapier/RBRapier/Renderer/SequenceMgr.py

    r338 r340  
    7070        self.OnBeginExecute.Update(context) 
    7171        for priority, element in self.Elements: 
    72             element.Execute(context) 
     72            if getattr(element, 'Active', 1): 
     73                element.Execute(context) 
    7374        self.OnEndExecute.Update(context) 
    7475 
  • trunk/RBRapier/RBRapier/Renderer/View/ClippingPlane.py

    r338 r340  
    2525 
    2626from OpenGL import GL 
     27from RBRapier.Tools import Vector 
    2728 
    2829#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    3536    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    3637 
    37     Active = 1 
     38    PlaneNumber = None 
     39    Equation = Vector.Vector4Property('Equation') 
    3840 
    39     PlaneNumber = None 
    40     Enabled = None 
    41     Equation = Vector.Vector4Property('Equation') 
     41    # TODO: hook up this attribute change thingy 
     42    context.AttributeMgr.Save(GL.GL_TRANSFORM_BIT) 
    4243 
    4344    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    4546    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4647 
    47     def __init__(self, PlaneNumber=None, Enabled=None, Equation=None): 
     48    def __init__(self, PlaneNumber=None, Equation=None): 
    4849        self.PlaneNumber = PlaneNumber 
    49         self.Enabled = Enabled 
    5050        if Equation is not None:  
    5151            self.Equation = Equation 
    5252 
    53     def Setup(self, context): 
    54         if not self.Active: return 
    55         if self.PlaneNumber is not None: 
    56             context.AttributeMgr.Save(GL.GL_TRANSFORM_BIT) 
    57             if self.Enabled is not None: 
    58                 context.StateMgr.SetState(self.Enabled, GL.GL_CLIP_PLANE0 + self.PlaneNumber) 
    59          
    60     def Draw(self, context): 
    61         if not self.Active: return 
     53    def Select(self, context): 
    6254        if self.PlaneNumber is not None: 
    6355            GL.glClipPlane(GL.GL_CLIP_PLANE0 + self.PlaneNumber, self.Equation.tolist()) 
     56            context.StateMgr.Enable(GL.GL_CLIP_PLANE0 + self.PlaneNumber) 
    6457         
     58    def Deselect(self, context): 
     59        if self.PlaneNumber is not None: 
     60            context.StateMgr.Disable(GL.GL_CLIP_PLANE0 + self.PlaneNumber) 
    6561 
    66 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    67  
  • trunk/RBRapier/RBRapier/Tools/Quaternion.py

    r337 r340  
    417417    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    418418 
     419    def asarray(self): 
     420        return self._array 
     421 
     422    def tolist(self): 
     423        return self._array 
     424 
    419425    def _SVfromRadianAxis(Klass, Radians, Axis): 
    420426        Radians *= .5 
  • trunk/RBRapier/RBRapier/Tools/Vector.py

    r337 r340  
    222222    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    223223 
     224    def asarray(self): 
     225        return self._array 
     226 
    224227    def tolist(self): 
    225228        return self._array.tolist() 
     
    402405    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    403406 
     407    def asarray(self): 
     408        return self._arrayh 
     409 
    404410    def tolist(self): 
    405411        return self._arrayh.tolist() 
  • trunk/RBRapier/doc/DesignLayout.xml

    r337 r340  
    11<?xml version='1.0'?> 
    22<project name='RuneBlade Rendering Project'> 
     3    <package name='Renderer'> 
     4        <package name='Geometry'> 
     5            NOTE: Don't forget support for selection and picking 
     6 
     7            <module name='Data'> 
     8                <object name='VertexArray'/> 
     9                <object name='NormalArray'/> 
     10                <object name='ColorArray'/> 
     11                <object name='TexCoordArray'/> 
     12                <object name='EdgeFlagArray'/> 
     13                <object name='WeightArray'/> 
     14            </module> 
     15 
     16            <module name='Traversal'> 
     17                <object name='Array Traversal'/> 
     18                Outstanding issues: 
     19                    * NV_element_array and NV_vertex_array_range 
     20                    * ATI_element_array and ATI_vertex_array_object 
     21                    * EXT_multi_draw_array 
     22                    * NV_primitive_restart 
     23            </module> 
     24 
     25            <object name='Immediate Mode'> 
     26                Provide something to derive from/implement so that 
     27                immediate mode tests are possible and simple. 
     28 
     29                Not really intended for production usage. 
     30            </object> 
     31        </package> 
     32 
     33        <package name='Image and Raster'> 
     34            <module name='Image Bitmaps'> 
     35                To be explored 
     36            </module> 
     37            <module name='Texture Objects'> 
     38                To be explored 
     39            </module> 
     40            To be explored 
     41 
     42            Look at: 
     43                Standard/simple 
     44                Multitexturing 
     45                Dot/Bump/Blend/Specular/Min/Max etc... 
     46                Spherical/Cubic environment mapping 
     47        </package> 
     48 
     49        <package name='Transformations'> 
     50            Model View (multiple) 
     51            Projection 
     52            Color 
     53            Texture (multiple?) 
     54        </package> 
     55 
     56        <package name='Appearance'> 
     57            <module name='Lighting and Lights' /> 
     58            <module name='LogicOp'> 
     59                NOTE: Avoid using -- slow 
     60            </module> 
     61            <module name='Fog'> 
     62                Outstanding issues: 
     63                    height fog 
     64            </module> 
     65            <module name='Blending'> 
     66                Blend seperation 
     67            </module> 
     68            <module name='Materials'> 
     69                Normal 
     70                Colored Materials 
     71            </module> 
     72        </package> 
     73 
     74        <package name='Environment'> 
     75            <module name='Accumulation' /> 
     76 
     77            <module name='Selection and Picking'> 
     78                Don't Forget this! 
     79            </module> 
     80 
     81            <module name='Stenciling'> 
     82                Outstanding issues: 
     83                    stencil wraping 
     84                    EXT_stencil_two_side 
     85            </module> 
     86 
     87            <module name='Fragment Tests' > 
     88                Scissor 
     89                Alpha 
     90                Stencil 
     91                Depth 
     92                See fragment programs and Cg as well 
     93            </module> 
     94 
     95            <module name='Buffers' > 
     96                Color 
     97                Accumulation 
     98                Depth 
     99                Stencil 
     100                Aux[] 
     101                PBuffer? 
     102            </module> 
     103        </package> 
     104 
     105        <package name='Programable Operations'> 
     106            Placeholder for Vertex, Fragment, and Texture programs 
     107            Cg also might here?  Not sure. 
     108        </package> 
     109 
     110        <package name='Managers'> 
     111            <module name='States'> 
     112                Both client and global states 
     113                Uses a checkpoint model 
     114            </module> 
     115            <module name='Attributes'> 
     116                Uses a checkpoint model 
     117            </module> 
     118            <module name='BufferClearing'> 
     119                Most effecient when clearing multiple buffers together... 
     120            </module> 
     121            <module name='Display List Cache' /> 
     122        </package> 
     123    </package> 
     124 
    3125    <package name='Tools'> 
    4126        <module name='Vector Library'/> 
     
    57179            <module name='Mass-spring interpolation'/> 
    58180            <module name='Other physics-based interpolation'/> 
    59         </package> 
    60     </package> 
    61  
    62     <package name='Renderer'> 
    63         <package name='Geometry'> 
    64             NOTE: Don't forget support for selection and picking 
    65  
    66             <module name='Data'> 
    67                 <object name='VertexArray'/> 
    68                 <object name='NormalArray'/> 
    69                 <object name='ColorArray'/> 
    70                 <object name='TexCoordArray'/> 
    71                 <object name='EdgeFlagArray'/> 
    72                 <object name='WeightArray'/> 
    73             </module> 
    74  
    75             <module name='Traversal'> 
    76                 <object name='Array Traversal'/> 
    77                 Outstanding issues: 
    78                     * NV_element_array and NV_vertex_array_range 
    79                     * ATI_element_array and ATI_vertex_array_object 
    80                     * EXT_multi_draw_array 
    81                     * NV_primitive_restart 
    82             </module> 
    83  
    84             <object name='Immediate Mode'> 
    85                 Provide something to derive from/implement so that 
    86                 immediate mode tests are possible and simple. 
    87  
    88                 Not really intended for production usage. 
    89             </object> 
    90         </package> 
    91  
    92         <package name='Image and Raster'> 
    93             <module name='Image Bitmaps'> 
    94                 To be explored 
    95             </module> 
    96             <module name='Texture Objects'> 
    97                 To be explored 
    98             </module> 
    99             To be explored 
    100  
    101             Look at: 
    102                 Standard/simple 
    103                 Multitexturing 
    104                 Dot/Bump/Blend/Specular/Min/Max etc... 
    105                 Spherical/Cubic environment mapping 
    106         </package> 
    107  
    108         <package name='Environment and Misc'> 
    109             <module name='Selection and Picking'> 
    110                 Don't Forget this! 
    111             </module> 
    112  
    113             <module name='Transformations'> 
    114                 Model View (multiple) 
    115                 Projection 
    116                 Color 
    117                 Texture (multiple?) 
    118             </module> 
    119             <module name='Lighting and Lights' /> 
    120             <module name='LogicOp'> 
    121                 NOTE: Avoid using -- slow 
    122             </module> 
    123             <module name='Fog'> 
    124                 Outstanding issues: 
    125                     height fog 
    126             </module> 
    127             <module name='Blending'> 
    128                 Blend seperation 
    129             </module> 
    130             <module name='Stenciling'> 
    131                 Outstanding issues: 
    132                     stencil wraping 
    133                     EXT_stencil_two_side 
    134             </module> 
    135             <module name='Accumulation' /> 
    136             <module name='Fragment Tests' > 
    137                 Scissor 
    138                 Alpha 
    139                 Stencil 
    140                 Depth 
    141                 See fragment programs and Cg as well 
    142             </module> 
    143             <module name='Buffers' > 
    144                 Color 
    145                 Accumulation 
    146                 Depth 
    147                 Stencil 
    148                 Aux[] 
    149                 PBuffer? 
    150             </module> 
    151         </package> 
    152  
    153         <package name='Programable Operations'> 
    154             Placeholder for Vertex, Fragment, and Texture programs 
    155             Cg also might here?  Not sure. 
    156         </package> 
    157  
    158         <package name='Managers'> 
    159             <module name='States'> 
    160                 Both client and global states 
    161                 Uses a checkpoint model 
    162             </module> 
    163             <module name='Attributes'> 
    164                 Uses a checkpoint model 
    165             </module> 
    166             <module name='BufferClearing'> 
    167                 Most effecient when clearing multiple buffers together... 
    168             </module> 
    169             <module name='Display List Cache' /> 
    170181        </package> 
    171182    </package>