#include <fillval.h>
Inheritance diagram for NoiseTranspFillAttribute:
Public Member Functions | |
NoiseTranspFillAttribute () | |
Implementation of NoiseTranspFillAttribute. | |
~NoiseTranspFillAttribute () | |
Destructor for NoiseTranspFillAttribute attribute values. | |
virtual NodeAttribute * | MakeNode () |
Make a AttrNoiseTranspFill node from this flat fill colour attribute. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual FillGeometryAttribute & | operator= (FillGeometryAttribute &Attrib) |
Make this Attribute the same as FillAttrib. | |
virtual INT32 | operator== (const FillGeometryAttribute &Attrib) |
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required. | |
virtual BOOL | AttachBitmap (KernelBitmap *pBitmap) |
Attaches a bitmap to this fill. | |
virtual BOOL | DetachBitmap () |
Detaches a bitmap from this fill. | |
virtual BOOL | CopyBitmap (KernelBitmap *) |
Used to copy a bitmap from one fill to another. | |
virtual BOOL | RecalcFractal () |
Recalculates the Fractal. | |
virtual UINT32 | GetFractalDim () |
virtual BOOL | GetTileable () |
virtual UINT32 | GetFractalDPI () |
virtual INT32 | GetSeed () |
virtual FIXED16 | GetGraininess () |
virtual void | SetTesselation (INT32 NewTess) |
virtual void | SetFractalDim (UINT32 NewDim) |
virtual BOOL | SetTileable (BOOL NewTile) |
virtual BOOL | SetFractalDPI (UINT32 NewDpi) |
virtual BOOL | SetSeed (INT32 NewSeed) |
virtual BOOL | SetGraininess (FIXED16 NewGrain) |
virtual BOOL | IsAKindOfBitmapFill () |
virtual BOOL | IsABitmapFill () |
virtual void | CacheFractalData (FillGeometryAttribute *pCachedFractal) |
Copies any data from this FractalFillAttribute into the cached fractal pointed to on entry. This data is then checked via IsSameAsCachedFractal. | |
virtual BOOL | IsSameAsCachedFractal (FillGeometryAttribute *pCachedFractal) |
A virtual comparison operator used by the fractal cache to check for a matching fractal. | |
virtual ColourFillAttribute * | MakeSimilarNonTranspFillGeometry (double TransparencyScale) |
Creates a non-transparent version of this transparent fill attribute. (The original use of this was so airbrushes could maintain their fill's transparency geometry). | |
virtual INT32 | GetGeometryShape () |
Private Attributes | |
UINT32 | dpi |
UINT32 | dim |
BOOL | tileable |
INT32 | seed |
FIXED16 | grain |
Definition at line 1391 of file fillval.h.
|
Implementation of NoiseTranspFillAttribute.
Definition at line 6323 of file fillval.cpp. 06324 { 06325 MonotonicTime time; 06326 seed = time.Sample(); 06327 06328 dpi = AttrFillGeometry::FractalDPI; 06329 dim = 0; 06330 tileable = TRUE; 06331 06332 grain = FIXED16(30); 06333 }
|
|
Destructor for NoiseTranspFillAttribute attribute values.
Definition at line 6347 of file fillval.cpp. 06348 { 06349 DetachBitmap(); 06350 }
|
|
Attaches a bitmap to this fill.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6536 of file fillval.cpp. 06537 { 06538 DetachBitmap(); 06539 06540 if (NewBitmap == NULL) 06541 return FALSE; 06542 06543 OILBitmap* Bmp = NewBitmap->ActualBitmap; 06544 if (Bmp == NULL || !Bmp->IsTemp()) 06545 return FALSE; 06546 06547 NewBitmap = new KernelBitmap(Bmp, TRUE); 06548 BitmapRef.SetBitmap(NewBitmap); 06549 GetApplication()->GetGlobalFractalList()->AddFractal(this); 06550 06551 return TRUE; 06552 }
|
|
Copies any data from this FractalFillAttribute into the cached fractal pointed to on entry. This data is then checked via IsSameAsCachedFractal.
Reimplemented from FillGeometryAttribute. Definition at line 6481 of file fillval.cpp. 06482 { 06483 ERROR3IF(pCachedFractal==NULL, "NULL pointer passed to NoiseTranspFillAttribute::CacheFractalData"); 06484 ERROR3IF(!IS_A(pCachedFractal,NoiseTranspFillAttribute), "Not a NoiseTranspFillAttribute during NoiseTranspFillAttribute::CacheFractalData"); 06485 06486 pCachedFractal->SetStartPoint(GetStartPoint()); 06487 pCachedFractal->SetEndPoint(GetEndPoint()); 06488 pCachedFractal->SetEndPoint2(GetEndPoint2()); 06489 06490 pCachedFractal->SetFractalDPI(GetFractalDPI()); 06491 pCachedFractal->SetFractalDim(GetFractalDim()); 06492 pCachedFractal->SetTileable(GetTileable()); 06493 pCachedFractal->SetSeed(GetSeed()); 06494 06495 pCachedFractal->SetGraininess(GetGraininess()); 06496 }
|
|
Used to copy a bitmap from one fill to another.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6593 of file fillval.cpp. 06594 { 06595 if (BmpToCopy != NULL) // Is there a bitmap to copy ? 06596 { 06597 DetachBitmap(); 06598 06599 return AttachBitmap(BmpToCopy); 06600 } 06601 06602 return TRUE; 06603 }
|
|
Detaches a bitmap from this fill.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6565 of file fillval.cpp. 06566 { 06567 if (GetBitmap() == NULL) 06568 return FALSE; 06569 06570 if (GetApplication()->GetGlobalFractalList()->RemoveFractal(this) && BitmapRef.GetBitmap()) 06571 { 06572 // The fractal was deleted, so make sure we NULL our pointer 06573 BitmapRef.GetBitmap()->ActualBitmap = NULL; 06574 } 06575 06576 // now make sure the kernelbitmap is dead too 06577 BitmapRef.DeleteBmp(); 06578 06579 return TRUE; 06580 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1411 of file fillval.h. 01411 { return dim; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1413 of file fillval.h. 01413 { return dpi; }
|
|
Reimplemented from BitmapTranspFillAttribute. Definition at line 1433 of file fillval.h. 01433 { return(FILLSHAPE_PLASMA); }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1415 of file fillval.h. 01415 { return grain; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1414 of file fillval.h. 01414 { return seed; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1412 of file fillval.h. 01412 { return tileable; }
|
|
Reimplemented from BitmapTranspFillAttribute. Definition at line 1426 of file fillval.h. 01426 { return FALSE; }
|
|
Reimplemented from BitmapTranspFillAttribute. Definition at line 1425 of file fillval.h. 01425 { return TRUE; }
|
|
A virtual comparison operator used by the fractal cache to check for a matching fractal.
Reimplemented from FillGeometryAttribute. Definition at line 6512 of file fillval.cpp. 06513 { 06514 ERROR3IF(pCachedFractal==NULL, "NULL pointer passed to NoiseTranspFillAttribute::IsSameAsCachedFractal"); 06515 ERROR3IF(!IS_A(pCachedFractal,NoiseTranspFillAttribute), "Not a NoiseTranspFillAttribute during NoiseTranspFillAttribute::IsSameAsCachedFractal"); 06516 06517 BOOL ok = (dim == pCachedFractal->GetFractalDim()); 06518 ok = ok && (tileable == pCachedFractal->GetTileable()); 06519 ok = ok && (seed == pCachedFractal->GetSeed()); 06520 ok = ok && (grain == pCachedFractal->GetGraininess()); 06521 06522 return ok; 06523 }
|
|
Make a AttrNoiseTranspFill node from this flat fill colour attribute.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6366 of file fillval.cpp. 06367 { 06368 // Create new attribute node 06369 AttrNoiseTranspFill *pAttr = new AttrNoiseTranspFill; 06370 if (pAttr==NULL) 06371 // error message has already been set by new 06372 return NULL; 06373 06374 // Copy attribute value into the new node. 06375 pAttr->GetAttributeValue()->SimpleCopy(this); 06376 06377 // Return the new node 06378 return pAttr; 06379 }
|
|
Creates a non-transparent version of this transparent fill attribute. (The original use of this was so airbrushes could maintain their fill's transparency geometry).
Reimplemented from BitmapTranspFillAttribute. Definition at line 6722 of file fillval.cpp. 06723 { 06724 UINT32 *pStartTransp = GetStartTransp(); 06725 UINT32 *pEndTransp = GetEndTransp(); 06726 06727 if(pStartTransp == NULL || pEndTransp == NULL) 06728 return NULL; 06729 06730 NoiseFillAttribute *pNewAttr = new NoiseFillAttribute; 06731 if (pNewAttr != NULL) 06732 { 06733 pNewAttr->SetStartPoint(GetStartPoint()); 06734 pNewAttr->SetEndPoint(GetEndPoint()); 06735 pNewAttr->SetEndPoint2(GetEndPoint2()); 06736 pNewAttr->SetEndPoint3(GetEndPoint3()); 06737 06738 pNewAttr->SetTesselation(GetTesselation()); 06739 pNewAttr->SetDPI(GetDPI()); 06740 if(IsPerspective()) 06741 pNewAttr->MakePerspective(); 06742 06743 pNewAttr->AttachBitmap(GetBitmap()); 06744 pNewAttr->SetFractalDim(GetFractalDim()); 06745 pNewAttr->SetTileable(GetTileable()); 06746 pNewAttr->SetFractalDPI(GetFractalDPI()); 06747 pNewAttr->SetSeed(GetSeed()); 06748 pNewAttr->SetNoiseScale(GetNoiseScale()); 06749 06750 INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale); 06751 INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale); 06752 06753 DocColour colorStart(StartTransparency, StartTransparency, StartTransparency); 06754 DocColour colorEnd1(EndTransparency, EndTransparency, EndTransparency); 06755 pNewAttr->SetStartColour(&colorStart); 06756 pNewAttr->SetEndColour(&colorEnd1); 06757 06758 pNewAttr->RecalcFractal(); 06759 } 06760 06761 return(pNewAttr); 06762 }
|
|
Make this Attribute the same as FillAttrib.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6395 of file fillval.cpp. 06396 { 06397 if (FillAttrib.IsKindOf(CC_RUNTIME_CLASS(NoiseTranspFillAttribute))) 06398 { 06399 dpi = ((NoiseTranspFillAttribute*)&FillAttrib)->dpi; 06400 dim = ((NoiseTranspFillAttribute*)&FillAttrib)->dim; 06401 tileable = ((NoiseTranspFillAttribute*)&FillAttrib)->tileable; 06402 seed = ((NoiseTranspFillAttribute*)&FillAttrib)->seed; 06403 grain = ((NoiseTranspFillAttribute*)&FillAttrib)->grain; 06404 } 06405 06406 return TranspFillAttribute::operator=(FillAttrib); 06407 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6426 of file fillval.cpp. 06427 { 06428 // is this the same class of object? 06429 if (GetRuntimeClass() != Attrib.GetRuntimeClass()) 06430 return FALSE; 06431 06432 NoiseTranspFillAttribute* pAttrib = (NoiseTranspFillAttribute*)&Attrib; 06433 06434 if (IsPerspective()) 06435 { 06436 if (!pAttrib->IsPerspective()) 06437 return FALSE; 06438 06439 if (*GetEndPoint3() != *pAttrib->GetEndPoint3()) 06440 return FALSE; 06441 } 06442 06443 // check the transparency ramp matches 06444 if (!SameTransparencyRampAs(pAttrib->GetTranspRamp())) 06445 return FALSE; 06446 06447 return 06448 ( 06449 *GetStartTransp() == *pAttrib->GetStartTransp() && 06450 *GetEndTransp() == *pAttrib->GetEndTransp() && 06451 06452 *GetStartPoint() == *pAttrib->GetStartPoint() && 06453 *GetEndPoint() == *pAttrib->GetEndPoint() && 06454 *GetEndPoint2() == *pAttrib->GetEndPoint2() && 06455 06456 GetTranspType() == pAttrib->GetTranspType() && 06457 06458 dpi == pAttrib->dpi && 06459 dim == pAttrib->dim && 06460 tileable == pAttrib->tileable && 06461 seed == pAttrib->seed && 06462 06463 grain == pAttrib->grain 06464 ); 06465 }
|
|
Recalculates the Fractal.
Reimplemented from FillGeometryAttribute. Definition at line 6637 of file fillval.cpp. 06638 { 06639 if (*GetStartPoint() == *GetEndPoint() || 06640 *GetStartPoint() == *GetEndPoint2()) 06641 { 06642 return FALSE; 06643 } 06644 06645 KernelBitmap* pBitmap = GenerateNoiseBitmap(grain,seed); 06646 if (pBitmap == NULL) 06647 { 06648 TRACEUSER( "Mike", _T("Noisy fractal Failed !!!\n")); 06649 return FALSE; // Error set by GenerateFractalBitmap 06650 } 06651 06652 AttachBitmap(pBitmap); 06653 delete pBitmap; 06654 06655 return TRUE; 06656 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 6668 of file fillval.cpp. 06669 { 06670 dim = NewDim; 06671 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 6682 of file fillval.cpp.
|
|
Reimplemented from FillGeometryAttribute. Definition at line 6691 of file fillval.cpp. 06692 { 06693 DetachBitmap(); // Ensure the current fractal is removed from cache 06694 06695 if (NewGrain<0) NewGrain=0; 06696 if (NewGrain>100) NewGrain=100; 06697 grain = NewGrain; 06698 06699 return TRUE; 06700 }
|
|
Values local to this fractal type Reimplemented from FillGeometryAttribute. Definition at line 6768 of file fillval.cpp. 06769 { 06770 DetachBitmap(); // Ensure the current fractal is removed from cache 06771 06772 seed = NewSeed; 06773 06774 return TRUE; 06775 }
|
|
Reimplemented from BitmapTranspFillAttribute. Definition at line 6660 of file fillval.cpp. 06661 { 06662 if (NewTess == RT_NoRepeatType) 06663 NewTess = RT_Repeating; 06664 06665 Tesselation = NewTess; 06666 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 6673 of file fillval.cpp. 06674 { 06675 DetachBitmap(); // Ensure the current fractal is removed from cache 06676 06677 tileable = NewTile; 06678 06679 return TRUE; 06680 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from BitmapTranspFillAttribute. Definition at line 6619 of file fillval.cpp. 06620 { 06621 // Just use the assignment operator 06622 *this = *(FillGeometryAttribute*)pValue; 06623 }
|
|
|
|
|
|
|
|
|
|
|