#include <fillval.h>
Inheritance diagram for NoiseFillAttribute:
Public Member Functions | |
NoiseFillAttribute () | |
Implementation of NoiseFillAttribute. | |
~NoiseFillAttribute () | |
virtual NodeAttribute * | MakeNode () |
Make a AttrFlatColourFill node from this flat fill colour attribute. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual FillGeometryAttribute & | operator= (FillGeometryAttribute &Attrib) |
Make the Attribute the same as the other. | |
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 () |
virtual UINT32 | GetFractalDim () |
virtual BOOL | GetTileable () |
virtual UINT32 | GetFractalDPI () |
virtual DocColour * | GetStartColour () |
Gets the Start colour of this fill. | |
virtual DocColour * | GetEndColour () |
Gets the End colour of this fill. | |
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 void | SetStartColour (DocColour *) |
Sets the start colour of this fill. | |
virtual void | SetEndColour (DocColour *) |
Sets the end colour of this fill. | |
virtual BOOL | SetSeed (INT32 NewSeed) |
virtual BOOL | SetGraininess (FIXED16 NewGrain) |
virtual BOOL | IsAKindOfBitmapFill () |
virtual BOOL | IsABitmapFill () |
virtual BOOL | IsATextureFill () |
virtual BOOL | IsANoiseFill () |
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 INT32 | GetGeometryShape () |
Private Attributes | |
INT32 | seed |
UINT32 | dpi |
BOOL | tileable |
UINT32 | dim |
FIXED16 | grain |
Definition at line 841 of file fillval.h.
|
Implementation of NoiseFillAttribute.
Definition at line 3527 of file fillval.cpp. 03528 { 03529 MonotonicTime time; 03530 seed = time.Sample(); 03531 03532 dpi = AttrFillGeometry::FractalDPI; 03533 dim = 0; 03534 tileable = TRUE; 03535 03536 grain = FIXED16(30.0); 03537 }
|
|
Definition at line 3540 of file fillval.cpp. 03541 { 03542 DetachBitmap(); 03543 }
|
|
Attaches a bitmap to this fill.
Reimplemented from BitmapFillAttribute. Definition at line 3650 of file fillval.cpp. 03651 { 03652 DetachBitmap(); 03653 03654 if (NewBitmap == NULL) 03655 return FALSE; 03656 03657 OILBitmap* Bmp = NewBitmap->ActualBitmap; 03658 if (Bmp == NULL || !Bmp->IsTemp()) 03659 return FALSE; 03660 03661 NewBitmap = new KernelBitmap(Bmp, TRUE); 03662 BitmapRef.SetBitmap(NewBitmap); 03663 GetApplication()->GetGlobalFractalList()->AddFractal(this); 03664 03665 return TRUE; 03666 }
|
|
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 3617 of file fillval.cpp. 03618 { 03619 ERROR3IF(pCachedFractal==NULL, "NULL pointer passed to NoiseFillAttribute::CacheFractalData"); 03620 ERROR3IF(!IS_A(pCachedFractal,NoiseFillAttribute), "Not a NoiseFillAttribute during NoiseFillAttribute::CacheFractalData"); 03621 03622 pCachedFractal->SetStartPoint(GetStartPoint()); 03623 pCachedFractal->SetEndPoint(GetEndPoint()); 03624 pCachedFractal->SetEndPoint2(GetEndPoint2()); 03625 03626 pCachedFractal->SetFractalDPI(GetFractalDPI()); 03627 pCachedFractal->SetFractalDim(GetFractalDim()); 03628 pCachedFractal->SetTileable(GetTileable()); 03629 pCachedFractal->SetSeed(GetSeed()); 03630 03631 pCachedFractal->SetGraininess(GetGraininess()); 03632 }
|
|
Used to copy a bitmap from one fill to another.
Reimplemented from BitmapFillAttribute. Definition at line 3688 of file fillval.cpp. 03689 { 03690 if (BmpToCopy != NULL) // Is there a bitmap to copy ? 03691 { 03692 DetachBitmap(); 03693 03694 return AttachBitmap(BmpToCopy); 03695 } 03696 03697 return TRUE; 03698 }
|
|
Detaches a bitmap from this fill.
Reimplemented from BitmapFillAttribute. Definition at line 3669 of file fillval.cpp. 03670 { 03671 if (GetBitmap() == NULL) 03672 return FALSE; 03673 03674 if (GetApplication()->GetGlobalFractalList()->RemoveFractal(this) && 03675 BitmapRef.GetBitmap()) 03676 { 03677 // The fractal was deleted, so make sure we NULL our pointer 03678 BitmapRef.GetBitmap()->ActualBitmap = NULL; 03679 } 03680 03681 // now make sure the kernelbitmap is dead too 03682 BitmapRef.DeleteBmp(); 03683 03684 return TRUE; 03685 }
|
|
Gets the End colour of this fill.
Reimplemented from BitmapFillAttribute. Definition at line 865 of file fillval.h. 00865 { return &EndColour; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 861 of file fillval.h. 00861 { return dim; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 863 of file fillval.h. 00863 { return dpi; }
|
|
Reimplemented from BitmapFillAttribute. Definition at line 889 of file fillval.h. 00889 { return(FILLSHAPE_PLASMA); }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 868 of file fillval.h. 00868 { return grain; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 867 of file fillval.h. 00867 { return seed; }
|
|
Gets the Start colour of this fill.
Reimplemented from BitmapFillAttribute. Definition at line 864 of file fillval.h. 00864 { return &Colour; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 862 of file fillval.h. 00862 { return tileable; }
|
|
Reimplemented from BitmapFillAttribute. Definition at line 882 of file fillval.h. 00882 { return FALSE; }
|
|
Reimplemented from BitmapFillAttribute. Definition at line 881 of file fillval.h. 00881 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 884 of file fillval.h. 00884 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 883 of file fillval.h. 00883 { return TRUE; }
|
|
A virtual comparison operator used by the fractal cache to check for a matching fractal.
Reimplemented from FillGeometryAttribute. Definition at line 3635 of file fillval.cpp. 03636 { 03637 ERROR3IF(pCachedFractal==NULL, "NULL pointer passed to NoiseFillAttribute::IsSameAsCachedFractal"); 03638 ERROR3IF(!IS_A(pCachedFractal,NoiseFillAttribute), "Not a NoiseFillAttribute during NoiseFillAttribute::IsSameAsCachedFractal"); 03639 03640 return 03641 ( 03642 dim == pCachedFractal->GetFractalDim() && 03643 tileable == pCachedFractal->GetTileable() && 03644 seed == pCachedFractal->GetSeed() && 03645 grain == pCachedFractal->GetGraininess() 03646 ); 03647 }
|
|
Make a AttrFlatColourFill node from this flat fill colour attribute.
Reimplemented from BitmapFillAttribute. Definition at line 3546 of file fillval.cpp. 03547 { 03548 // Create new attribute node 03549 AttrNoiseColourFill *pAttr = new AttrNoiseColourFill; 03550 if (pAttr==NULL) 03551 // error message has already been set by new 03552 return NULL; 03553 03554 // Copy attribute value into the new node. 03555 pAttr->GetAttributeValue()->SimpleCopy(this); 03556 03557 // Return the new node 03558 return pAttr; 03559 }
|
|
Make the Attribute the same as the other.
Reimplemented from BitmapFillAttribute. Definition at line 3562 of file fillval.cpp. 03563 { 03564 if (FillAttrib.IsKindOf(CC_RUNTIME_CLASS(NoiseFillAttribute))) 03565 { 03566 tileable = ((NoiseFillAttribute*)&FillAttrib)->tileable; 03567 grain = ((NoiseFillAttribute*)&FillAttrib)->grain; 03568 seed = ((NoiseFillAttribute*)&FillAttrib)->seed; 03569 dim = ((NoiseFillAttribute*)&FillAttrib)->dim; 03570 dpi = ((NoiseFillAttribute*)&FillAttrib)->dpi; 03571 } 03572 03573 return ColourFillAttribute::operator=(FillAttrib); 03574 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from BitmapFillAttribute. Definition at line 3577 of file fillval.cpp. 03578 { 03579 // is this the same class of object? 03580 if (GetRuntimeClass() != Attrib.GetRuntimeClass()) 03581 return FALSE; 03582 03583 NoiseFillAttribute* pAttrib = (NoiseFillAttribute*)&Attrib; 03584 03585 if (IsPerspective()) 03586 { 03587 if (!pAttrib->IsPerspective()) 03588 return FALSE; 03589 03590 if (*GetEndPoint3() != *pAttrib->GetEndPoint3()) 03591 return FALSE; 03592 } 03593 03594 // check the colour ramps match 03595 if (!SameColourRampAs(pAttrib->GetColourRamp())) 03596 return FALSE; 03597 03598 return 03599 ( 03600 *GetStartColour() == *pAttrib->GetStartColour() && 03601 *GetEndColour() == *pAttrib->GetEndColour() && 03602 03603 *GetStartPoint() == *pAttrib->GetStartPoint() && 03604 *GetEndPoint() == *pAttrib->GetEndPoint() && 03605 *GetEndPoint2() == *pAttrib->GetEndPoint2() && 03606 03607 dim == pAttrib->dim && 03608 dpi == pAttrib->dpi && 03609 tileable == pAttrib->tileable && 03610 03611 grain == pAttrib->grain && 03612 seed == pAttrib->seed 03613 ); 03614 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3745 of file fillval.cpp. 03746 { 03747 if (*GetStartPoint() == *GetEndPoint() || 03748 *GetStartPoint() == *GetEndPoint2()) 03749 { 03750 return FALSE; 03751 } 03752 03753 KernelBitmap* pBitmap = GenerateNoiseBitmap(grain,seed); 03754 if (pBitmap == NULL) 03755 { 03756 TRACEUSER( "Mike", _T("Noisy fractal Failed !!!\n")); 03757 return FALSE; // Error set by GenerateFractalBitmap 03758 } 03759 03760 AttachBitmap(pBitmap); 03761 delete pBitmap; 03762 03763 return TRUE; 03764 }
|
|
Sets the end colour of this fill.
Reimplemented from BitmapFillAttribute. Definition at line 3726 of file fillval.cpp. 03727 { 03728 if (NewCol == NULL) 03729 { 03730 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 03731 _R(IDS_BLACKNAME), &EndColour); 03732 03733 if (Colour == EndColour) 03734 { 03735 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 03736 _R(IDS_WHITENAME), &EndColour); 03737 } 03738 } 03739 else 03740 EndColour = *NewCol; 03741 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3775 of file fillval.cpp. 03776 { 03777 dim=NewDim; 03778 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3789 of file fillval.cpp.
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3797 of file fillval.cpp. 03798 { 03799 DetachBitmap(); // Ensure the current fractal is removed from cache 03800 03801 if (NewGrain<0) NewGrain=0; 03802 if (NewGrain>100) NewGrain=100; 03803 grain = NewGrain; 03804 03805 return TRUE; 03806 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3809 of file fillval.cpp. 03810 { 03811 DetachBitmap(); // Ensure the current fractal is removed from cache 03812 03813 seed = NewSeed; 03814 03815 return TRUE; 03816 }
|
|
Sets the start colour of this fill.
Reimplemented from BitmapFillAttribute. Definition at line 3708 of file fillval.cpp. 03709 { 03710 if (NewCol == NULL) 03711 { 03712 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 03713 _R(IDS_WHITENAME), &Colour); 03714 03715 if (Colour == EndColour) 03716 { 03717 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 03718 _R(IDS_BLACKNAME), &Colour); 03719 } 03720 } 03721 else 03722 Colour = *NewCol; 03723 }
|
|
Reimplemented from BitmapFillAttribute. Definition at line 3767 of file fillval.cpp. 03768 { 03769 if (NewTess == RT_NoRepeatType) 03770 NewTess = RT_Repeating; 03771 03772 Tesselation = NewTess; 03773 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 3780 of file fillval.cpp. 03781 { 03782 DetachBitmap(); // Ensure the current fractal is removed from cache 03783 03784 tileable = NewTile; 03785 03786 return TRUE; 03787 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from BitmapFillAttribute. Definition at line 3701 of file fillval.cpp. 03702 { 03703 // Just use the assignment operator 03704 *this = *(FillGeometryAttribute*)pValue; 03705 }
|
|
|
|
|
|
|
|
|
|
|