Ignore:
Timestamp:
Apr 9, 2015, 9:58:36 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Use csOpaque control style also to Image, PaintBox and OpenGLControl.
  • Modified: Change size of test frame with SpinEdits as delayed using timer.
  • Updated: BRGABitmap package to version 8.1.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/Packages/bgrabitmap/bgrascene3dinterface.inc

    r452 r472  
    44  { IBGRALight3D }
    55
    6   IBGRALight3D = interface
     6  IBGRALight3D = interface ['{85C683B6-07AC-4B8D-9324-06BC22882433}']
    77    procedure ComputeDiffuseLightness(Context: PSceneLightingContext);
    88    procedure ComputeDiffuseColor(Context: PSceneLightingContext);
     
    3030  end;
    3131
    32   IBGRAPointLight3D = interface(IBGRALight3D)
     32  IBGRAPointLight3D = interface(IBGRALight3D) ['{C939900D-DDD6-49F0-B1E9-E29F94FDB4C8}']
    3333    function GetVertex: IBGRAVertex3D;
    3434    procedure SetVertex(const AValue: IBGRAVertex3D);
     
    3636  end;
    3737
    38   IBGRADirectionalLight3D = interface(IBGRALight3D)
     38  IBGRADirectionalLight3D = interface(IBGRALight3D) ['{8D575CEE-8DD2-46FB-9BCC-17DE3DAAF53D}']
    3939    function GetDirection: TPoint3D;
    4040    procedure SetDirection(const AValue: TPoint3D);
     
    4545
    4646  IBGRAMaterial3D = interface
     47    function GetAmbiantAlpha: byte;
     48    function GetAutoAmbiantColor: boolean;
    4749    function GetAutoDiffuseColor: boolean;
     50    function GetAutoSimpleColor: boolean;
    4851    function GetAutoSpecularColor: boolean;
     52    function GetAmbiantColor: TBGRAPixel;
     53    function GetAmbiantColorF: TColorF;
     54    function GetAmbiantColorInt: TColorInt65536;
     55    function GetDiffuseAlpha: byte;
    4956    function GetDiffuseColor: TBGRAPixel;
    5057    function GetDiffuseColorF: TColorF;
    5158    function GetDiffuseColorInt: TColorInt65536;
    5259    function GetLightThroughFactor: single;
     60    function GetName: string;
    5361    function GetSaturationHigh: single;
    5462    function GetSaturationLow: single;
     63    function GetSimpleAlpha: byte;
     64    function GetSimpleColor: TBGRAPixel;
     65    function GetSimpleColorF: TColorF;
     66    function GetSimpleColorInt: TColorInt65536;
    5567    function GetSpecularColor: TBGRAPixel;
    5668    function GetSpecularColorF: TColorF;
     
    5870    function GetSpecularIndex: integer;
    5971    function GetSpecularOn: boolean;
     72    function GetTexture: IBGRAScanner;
     73    function GetTextureZoom: TPointF;
     74    procedure SetAmbiantAlpha(AValue: byte);
    6075    procedure SetAutoDiffuseColor(const AValue: boolean);
    6176    procedure SetAutoSpecularColor(const AValue: boolean);
     77    procedure SetAmbiantColor(const AValue: TBGRAPixel);
     78    procedure SetAmbiantColorF(const AValue: TColorF);
     79    procedure SetAmbiantColorInt(const AValue: TColorInt65536);
     80    procedure SetDiffuseAlpha(AValue: byte);
    6281    procedure SetDiffuseColor(const AValue: TBGRAPixel);
    6382    procedure SetDiffuseColorF(const AValue: TColorF);
    6483    procedure SetDiffuseColorInt(const AValue: TColorInt65536);
    6584    procedure SetLightThroughFactor(const AValue: single);
     85    procedure SetName(const AValue: string);
    6686    procedure SetSaturationHigh(const AValue: single);
    6787    procedure SetSaturationLow(const AValue: single);
     88    procedure SetSimpleAlpha(AValue: byte);
     89    procedure SetSimpleColor(AValue: TBGRAPixel);
     90    procedure SetSimpleColorF(AValue: TColorF);
     91    procedure SetSimpleColorInt(AValue: TColorInt65536);
    6892    procedure SetSpecularColor(const AValue: TBGRAPixel);
    6993    procedure SetSpecularColorF(const AValue: TColorF);
     
    7195    procedure SetSpecularIndex(const AValue: integer);
    7296    function GetAsObject: TObject;
     97    procedure SetTexture(AValue: IBGRAScanner);
     98    procedure SetTextureZoom(AValue: TPointF);
     99
     100    property AutoSimpleColor: boolean read GetAutoSimpleColor;
     101    property SimpleColor: TBGRAPixel read GetSimpleColor write SetSimpleColor;
     102    property SimpleColorF: TColorF read GetSimpleColorF write SetSimpleColorF;
     103    property SimpleColorInt: TColorInt65536 read GetSimpleColorInt write SetSimpleColorInt;
     104    property SimpleAlpha: byte read GetSimpleAlpha write SetSimpleAlpha;
     105
     106    property AmbiantColor: TBGRAPixel read GetAmbiantColor write SetAmbiantColor;
     107    property AmbiantColorF: TColorF read GetAmbiantColorF write SetAmbiantColorF;
     108    property AmbiantColorInt: TColorInt65536 read GetAmbiantColorInt write SetAmbiantColorInt;
     109    property AutoAmbiantColor: boolean read GetAutoAmbiantColor;
     110    property AmbiantAlpha: byte read GetAmbiantAlpha write SetAmbiantAlpha;
     111    property Texture: IBGRAScanner read GetTexture write SetTexture;
     112    property TextureZoom: TPointF read GetTextureZoom write SetTextureZoom;
    73113
    74114    property DiffuseColor: TBGRAPixel read GetDiffuseColor write SetDiffuseColor;
     
    76116    property DiffuseColorInt: TColorInt65536 read GetDiffuseColorInt write SetDiffuseColorInt;
    77117    property AutoDiffuseColor: boolean read GetAutoDiffuseColor write SetAutoDiffuseColor;
     118    property DiffuseAlpha: byte read GetDiffuseAlpha write SetDiffuseAlpha;
    78119    property SaturationLow: single read GetSaturationLow write SetSaturationLow;
    79120    property SaturationHigh: single read GetSaturationHigh write SetSaturationHigh;
     
    87128
    88129    property LightThroughFactor: single read GetLightThroughFactor write SetLightThroughFactor;
     130    property Name: string read GetName write SetName;
     131  end;
     132
     133  { IBGRANormal3D }
     134
     135  IBGRANormal3D = interface
     136    function GetCustomNormal: TPoint3D;
     137    function GetCustomNormal_128: TPoint3D_128;
     138    function GetViewNormal: TPoint3D;
     139    function GetViewNormal_128: TPoint3D_128;
     140    procedure SetCustomNormal(AValue: TPoint3D);
     141    procedure SetCustomNormal_128(AValue: TPoint3D_128);
     142    procedure SetViewNormal(AValue: TPoint3D);
     143    procedure SetViewNormal_128(AValue: TPoint3D_128);
     144    property ViewNormal: TPoint3D read GetViewNormal write SetViewNormal;
     145    property ViewNormal_128: TPoint3D_128 read GetViewNormal_128 write SetViewNormal_128;
     146    property CustomNormal: TPoint3D read GetCustomNormal write SetCustomNormal;
     147    property CustomNormal_128: TPoint3D_128 read GetCustomNormal_128 write SetCustomNormal_128;
    89148  end;
    90149
     
    93152  IBGRAVertex3D = interface
    94153    function GetColor: TBGRAPixel;
     154    function GetCustomFlags: DWord;
     155    function GetCustomNormal: TPoint3D;
     156    function GetCustomNormal_128: TPoint3D_128;
    95157    function GetLight: Single;
    96158    function GetProjectedCoord: TPointF;
     
    107169    function GetViewCoordZ: single;
    108170    procedure SetColor(const AValue: TBGRAPixel);
     171    procedure SetCustomFlags(AValue: DWord);
     172    procedure SetCustomNormal(AValue: TPoint3D);
     173    procedure SetCustomNormal_128(AValue: TPoint3D_128);
    109174    procedure SetLight(const AValue: Single);
    110175    procedure SetProjectedCoord(const AValue: TPointF);
     
    131196    property ViewNormal: TPoint3D read GetViewNormal write SetViewNormal;
    132197    property ViewNormal_128: TPoint3D_128 read GetViewNormal_128 write SetViewNormal_128;
     198    property CustomNormal: TPoint3D read GetCustomNormal write SetCustomNormal;
     199    property CustomNormal_128: TPoint3D_128 read GetCustomNormal_128 write SetCustomNormal_128;
    133200    property Usage: integer read GetUsage;
     201    property CustomFlags: DWord read GetCustomFlags write SetCustomFlags;
    134202    function GetAsObject: TObject;
    135203  end;
    136204
    137205  arrayOfIBGRAVertex3D = array of IBGRAVertex3D;
     206  TVertex3DCallback = procedure(AVertex: IBGRAVertex3D) of object;
    138207
    139208  { IBGRAPart3D }
     
    143212    function Add(x,y,z: single): IBGRAVertex3D;
    144213    function Add(pt: TPoint3D): IBGRAVertex3D;
     214    function Add(pt: TPoint3D; normal: TPoint3D): IBGRAVertex3D;
    145215    function Add(pt: TPoint3D_128): IBGRAVertex3D;
     216    function Add(pt: TPoint3D_128; normal: TPoint3D_128): IBGRAVertex3D;
     217    function AddNormal(x,y,z: single): IBGRANormal3D;
     218    function AddNormal(pt: TPoint3D): IBGRANormal3D;
     219    function AddNormal(pt: TPoint3D_128): IBGRANormal3D;
    146220    function Add(const coords: array of single): arrayOfIBGRAVertex3D;
    147221    function Add(const pts: array of TPoint3D): arrayOfIBGRAVertex3D;
     
    149223    procedure Add(const pts: array of IBGRAVertex3D);
    150224    procedure Add(AVertex: IBGRAVertex3D);
     225    function GetTotalNormalCount: integer;
    151226    function IndexOf(AVertex: IBGRAVertex3D): integer;
    152227    procedure RemoveVertex(Index: integer);
     228    procedure RemoveNormal(Index: integer);
    153229    function GetBoundingBox: TBox3D;
    154230    function GetMatrix: TMatrix3D;
     
    158234    function GetVertex(AIndex: Integer): IBGRAVertex3D;
    159235    function GetVertexCount: integer;
     236    function GetNormal(AIndex: Integer): IBGRANormal3D;
     237    function GetNormalCount: integer;
    160238    function GetTotalVertexCount: integer;
    161239    function GetContainer: IBGRAPart3D;
     
    165243    procedure Scale(size: TPoint3D; Before: boolean = true);
    166244    procedure SetMatrix(const AValue: TMatrix3D);
    167     procedure SetVertex(AIndex: Integer; const AValue: IBGRAVertex3D);
     245    procedure SetNormal(AIndex: Integer; AValue: IBGRANormal3D);
     246    procedure SetVertex(AIndex: Integer; AValue: IBGRAVertex3D);
    168247    procedure Translate(x,y,z: single; Before: boolean = true);
    169248    procedure Translate(ofs: TPoint3D; Before: boolean = true);
     
    180259    procedure RemoveUnusedVertices;
    181260    function CreatePart: IBGRAPart3D;
     261    procedure ForEachVertex(ACallback: TVertex3DCallback);
    182262    property VertexCount: integer read GetVertexCount;
     263    property NormalCount: integer read GetNormalCount;
    183264    property Vertex[AIndex: Integer]: IBGRAVertex3D read GetVertex write SetVertex;
     265    property Normal[AIndex: Integer]: IBGRANormal3D read GetNormal write SetNormal;
    184266    property Matrix: TMatrix3D read GetMatrix write SetMatrix;
    185267    property PartCount: integer read GetPartCount;
     
    188270    property BoundingBox: TBox3D read GetBoundingBox;
    189271    property TotalVertexCount: integer read GetTotalVertexCount;
     272    property TotalNormalCount: integer read GetTotalNormalCount;
    190273    property Container: IBGRAPart3D read GetContainer;
    191274  end;
     
    196279
    197280  IBGRAFace3D = interface
    198     procedure AddVertex(AVertex: IBGRAVertex3D);
     281    function AddVertex(AVertex: IBGRAVertex3D): integer;
    199282    function GetBiface: boolean;
     283    function GetCustomFlags: DWord;
    200284    function GetLightThroughFactorOverride: boolean;
    201285    function GetMaterial: IBGRAMaterial3D;
     
    207291    function GetTexture: IBGRAScanner;
    208292    function GetVertex(AIndex: Integer): IBGRAVertex3D;
     293    function GetNormal(AIndex: Integer): IBGRANormal3D;
    209294    function GetVertexColor(AIndex: Integer): TBGRAPixel;
    210295    function GetVertexColorOverride(AIndex: Integer): boolean;
     
    216301    function GetViewNormal_128: TPoint3D_128;
    217302    function GetLightThroughFactor: single;
     303    procedure SetCustomFlags(AValue: DWord);
    218304    procedure SetLightThroughFactor(const AValue: single);
    219305    procedure SetBiface(const AValue: boolean);
     
    225311    procedure SetTexCoordOverride(AIndex: Integer; const AValue: boolean);
    226312    procedure SetTexture(const AValue: IBGRAScanner);
    227     procedure SetVertex(AIndex: Integer; const AValue: IBGRAVertex3D);
     313    procedure SetVertex(AIndex: Integer; AValue: IBGRAVertex3D);
     314    procedure SetNormal(AIndex: Integer; AValue: IBGRANormal3D);
    228315    procedure SetVertexColor(AIndex: Integer; const AValue: TBGRAPixel);
    229316    procedure SetVertexColorOverride(AIndex: Integer; const AValue: boolean);
     
    250337    property MaterialName: string read GetMaterialName write SetMaterialName;
    251338    function GetAsObject: TObject;
    252   end;
     339    property CustomFlags: DWord read GetCustomFlags write SetCustomFlags;
     340  end;
     341
     342  TFace3DCallback = procedure(AFace: IBGRAFace3D) of object;
    253343
    254344  { IBGRAObject3D }
     
    261351    function GetMaterial: IBGRAMaterial3D;
    262352    function GetRefCount: integer;
     353    function GetTotalNormalCount: integer;
    263354    function GetTotalVertexCount: integer;
    264355    function GetLight: Single;
     
    274365    procedure SetParentLighting(const AValue: boolean);
    275366    procedure SetTexture(const AValue: IBGRAScanner);
    276     procedure ComputeWithMatrix(const AMatrix: TMatrix3D; const AProjection: TProjection3D);
     367    procedure ComputeWithMatrix(constref AMatrix: TMatrix3D; constref AProjection: TProjection3D);
    277368    procedure RemoveUnusedVertices;
     369    procedure ForEachVertex(ACallback: TVertex3DCallback);
     370    procedure ForEachFace(ACallback: TFace3DCallback);
    278371    function AddFaceReversed(const AVertices: array of IBGRAVertex3D): IBGRAFace3D;
    279372    function AddFace(const AVertices: array of IBGRAVertex3D): IBGRAFace3D;
     
    293386    property ParentLighting: boolean read GetParentLighting write SetParentLighting;
    294387    property TotalVertexCount: integer read GetTotalVertexCount;
     388    property TotalNormalCount: integer read GetTotalNormalCount;
    295389    property Material: IBGRAMaterial3D read GetMaterial write SetMaterial;
    296390    property Scene: TBGRAScene3D read GetScene;
Note: See TracChangeset for help on using the changeset viewer.