Changeset 472 for GraphicTest/Packages/bgrabitmap/bgrascene3dinterface.inc
- Timestamp:
- Apr 9, 2015, 9:58:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/bgrabitmap/bgrascene3dinterface.inc
r452 r472 4 4 { IBGRALight3D } 5 5 6 IBGRALight3D = interface 6 IBGRALight3D = interface ['{85C683B6-07AC-4B8D-9324-06BC22882433}'] 7 7 procedure ComputeDiffuseLightness(Context: PSceneLightingContext); 8 8 procedure ComputeDiffuseColor(Context: PSceneLightingContext); … … 30 30 end; 31 31 32 IBGRAPointLight3D = interface(IBGRALight3D) 32 IBGRAPointLight3D = interface(IBGRALight3D) ['{C939900D-DDD6-49F0-B1E9-E29F94FDB4C8}'] 33 33 function GetVertex: IBGRAVertex3D; 34 34 procedure SetVertex(const AValue: IBGRAVertex3D); … … 36 36 end; 37 37 38 IBGRADirectionalLight3D = interface(IBGRALight3D) 38 IBGRADirectionalLight3D = interface(IBGRALight3D) ['{8D575CEE-8DD2-46FB-9BCC-17DE3DAAF53D}'] 39 39 function GetDirection: TPoint3D; 40 40 procedure SetDirection(const AValue: TPoint3D); … … 45 45 46 46 IBGRAMaterial3D = interface 47 function GetAmbiantAlpha: byte; 48 function GetAutoAmbiantColor: boolean; 47 49 function GetAutoDiffuseColor: boolean; 50 function GetAutoSimpleColor: boolean; 48 51 function GetAutoSpecularColor: boolean; 52 function GetAmbiantColor: TBGRAPixel; 53 function GetAmbiantColorF: TColorF; 54 function GetAmbiantColorInt: TColorInt65536; 55 function GetDiffuseAlpha: byte; 49 56 function GetDiffuseColor: TBGRAPixel; 50 57 function GetDiffuseColorF: TColorF; 51 58 function GetDiffuseColorInt: TColorInt65536; 52 59 function GetLightThroughFactor: single; 60 function GetName: string; 53 61 function GetSaturationHigh: single; 54 62 function GetSaturationLow: single; 63 function GetSimpleAlpha: byte; 64 function GetSimpleColor: TBGRAPixel; 65 function GetSimpleColorF: TColorF; 66 function GetSimpleColorInt: TColorInt65536; 55 67 function GetSpecularColor: TBGRAPixel; 56 68 function GetSpecularColorF: TColorF; … … 58 70 function GetSpecularIndex: integer; 59 71 function GetSpecularOn: boolean; 72 function GetTexture: IBGRAScanner; 73 function GetTextureZoom: TPointF; 74 procedure SetAmbiantAlpha(AValue: byte); 60 75 procedure SetAutoDiffuseColor(const AValue: boolean); 61 76 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); 62 81 procedure SetDiffuseColor(const AValue: TBGRAPixel); 63 82 procedure SetDiffuseColorF(const AValue: TColorF); 64 83 procedure SetDiffuseColorInt(const AValue: TColorInt65536); 65 84 procedure SetLightThroughFactor(const AValue: single); 85 procedure SetName(const AValue: string); 66 86 procedure SetSaturationHigh(const AValue: single); 67 87 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); 68 92 procedure SetSpecularColor(const AValue: TBGRAPixel); 69 93 procedure SetSpecularColorF(const AValue: TColorF); … … 71 95 procedure SetSpecularIndex(const AValue: integer); 72 96 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; 73 113 74 114 property DiffuseColor: TBGRAPixel read GetDiffuseColor write SetDiffuseColor; … … 76 116 property DiffuseColorInt: TColorInt65536 read GetDiffuseColorInt write SetDiffuseColorInt; 77 117 property AutoDiffuseColor: boolean read GetAutoDiffuseColor write SetAutoDiffuseColor; 118 property DiffuseAlpha: byte read GetDiffuseAlpha write SetDiffuseAlpha; 78 119 property SaturationLow: single read GetSaturationLow write SetSaturationLow; 79 120 property SaturationHigh: single read GetSaturationHigh write SetSaturationHigh; … … 87 128 88 129 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; 89 148 end; 90 149 … … 93 152 IBGRAVertex3D = interface 94 153 function GetColor: TBGRAPixel; 154 function GetCustomFlags: DWord; 155 function GetCustomNormal: TPoint3D; 156 function GetCustomNormal_128: TPoint3D_128; 95 157 function GetLight: Single; 96 158 function GetProjectedCoord: TPointF; … … 107 169 function GetViewCoordZ: single; 108 170 procedure SetColor(const AValue: TBGRAPixel); 171 procedure SetCustomFlags(AValue: DWord); 172 procedure SetCustomNormal(AValue: TPoint3D); 173 procedure SetCustomNormal_128(AValue: TPoint3D_128); 109 174 procedure SetLight(const AValue: Single); 110 175 procedure SetProjectedCoord(const AValue: TPointF); … … 131 196 property ViewNormal: TPoint3D read GetViewNormal write SetViewNormal; 132 197 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; 133 200 property Usage: integer read GetUsage; 201 property CustomFlags: DWord read GetCustomFlags write SetCustomFlags; 134 202 function GetAsObject: TObject; 135 203 end; 136 204 137 205 arrayOfIBGRAVertex3D = array of IBGRAVertex3D; 206 TVertex3DCallback = procedure(AVertex: IBGRAVertex3D) of object; 138 207 139 208 { IBGRAPart3D } … … 143 212 function Add(x,y,z: single): IBGRAVertex3D; 144 213 function Add(pt: TPoint3D): IBGRAVertex3D; 214 function Add(pt: TPoint3D; normal: TPoint3D): IBGRAVertex3D; 145 215 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; 146 220 function Add(const coords: array of single): arrayOfIBGRAVertex3D; 147 221 function Add(const pts: array of TPoint3D): arrayOfIBGRAVertex3D; … … 149 223 procedure Add(const pts: array of IBGRAVertex3D); 150 224 procedure Add(AVertex: IBGRAVertex3D); 225 function GetTotalNormalCount: integer; 151 226 function IndexOf(AVertex: IBGRAVertex3D): integer; 152 227 procedure RemoveVertex(Index: integer); 228 procedure RemoveNormal(Index: integer); 153 229 function GetBoundingBox: TBox3D; 154 230 function GetMatrix: TMatrix3D; … … 158 234 function GetVertex(AIndex: Integer): IBGRAVertex3D; 159 235 function GetVertexCount: integer; 236 function GetNormal(AIndex: Integer): IBGRANormal3D; 237 function GetNormalCount: integer; 160 238 function GetTotalVertexCount: integer; 161 239 function GetContainer: IBGRAPart3D; … … 165 243 procedure Scale(size: TPoint3D; Before: boolean = true); 166 244 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); 168 247 procedure Translate(x,y,z: single; Before: boolean = true); 169 248 procedure Translate(ofs: TPoint3D; Before: boolean = true); … … 180 259 procedure RemoveUnusedVertices; 181 260 function CreatePart: IBGRAPart3D; 261 procedure ForEachVertex(ACallback: TVertex3DCallback); 182 262 property VertexCount: integer read GetVertexCount; 263 property NormalCount: integer read GetNormalCount; 183 264 property Vertex[AIndex: Integer]: IBGRAVertex3D read GetVertex write SetVertex; 265 property Normal[AIndex: Integer]: IBGRANormal3D read GetNormal write SetNormal; 184 266 property Matrix: TMatrix3D read GetMatrix write SetMatrix; 185 267 property PartCount: integer read GetPartCount; … … 188 270 property BoundingBox: TBox3D read GetBoundingBox; 189 271 property TotalVertexCount: integer read GetTotalVertexCount; 272 property TotalNormalCount: integer read GetTotalNormalCount; 190 273 property Container: IBGRAPart3D read GetContainer; 191 274 end; … … 196 279 197 280 IBGRAFace3D = interface 198 procedure AddVertex(AVertex: IBGRAVertex3D);281 function AddVertex(AVertex: IBGRAVertex3D): integer; 199 282 function GetBiface: boolean; 283 function GetCustomFlags: DWord; 200 284 function GetLightThroughFactorOverride: boolean; 201 285 function GetMaterial: IBGRAMaterial3D; … … 207 291 function GetTexture: IBGRAScanner; 208 292 function GetVertex(AIndex: Integer): IBGRAVertex3D; 293 function GetNormal(AIndex: Integer): IBGRANormal3D; 209 294 function GetVertexColor(AIndex: Integer): TBGRAPixel; 210 295 function GetVertexColorOverride(AIndex: Integer): boolean; … … 216 301 function GetViewNormal_128: TPoint3D_128; 217 302 function GetLightThroughFactor: single; 303 procedure SetCustomFlags(AValue: DWord); 218 304 procedure SetLightThroughFactor(const AValue: single); 219 305 procedure SetBiface(const AValue: boolean); … … 225 311 procedure SetTexCoordOverride(AIndex: Integer; const AValue: boolean); 226 312 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); 228 315 procedure SetVertexColor(AIndex: Integer; const AValue: TBGRAPixel); 229 316 procedure SetVertexColorOverride(AIndex: Integer; const AValue: boolean); … … 250 337 property MaterialName: string read GetMaterialName write SetMaterialName; 251 338 function GetAsObject: TObject; 252 end; 339 property CustomFlags: DWord read GetCustomFlags write SetCustomFlags; 340 end; 341 342 TFace3DCallback = procedure(AFace: IBGRAFace3D) of object; 253 343 254 344 { IBGRAObject3D } … … 261 351 function GetMaterial: IBGRAMaterial3D; 262 352 function GetRefCount: integer; 353 function GetTotalNormalCount: integer; 263 354 function GetTotalVertexCount: integer; 264 355 function GetLight: Single; … … 274 365 procedure SetParentLighting(const AValue: boolean); 275 366 procedure SetTexture(const AValue: IBGRAScanner); 276 procedure ComputeWithMatrix(const AMatrix: TMatrix3D; constAProjection: TProjection3D);367 procedure ComputeWithMatrix(constref AMatrix: TMatrix3D; constref AProjection: TProjection3D); 277 368 procedure RemoveUnusedVertices; 369 procedure ForEachVertex(ACallback: TVertex3DCallback); 370 procedure ForEachFace(ACallback: TFace3DCallback); 278 371 function AddFaceReversed(const AVertices: array of IBGRAVertex3D): IBGRAFace3D; 279 372 function AddFace(const AVertices: array of IBGRAVertex3D): IBGRAFace3D; … … 293 386 property ParentLighting: boolean read GetParentLighting write SetParentLighting; 294 387 property TotalVertexCount: integer read GetTotalVertexCount; 388 property TotalNormalCount: integer read GetTotalNormalCount; 295 389 property Material: IBGRAMaterial3D read GetMaterial write SetMaterial; 296 390 property Scene: TBGRAScene3D read GetScene;
Note:
See TracChangeset
for help on using the changeset viewer.