[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kpovmodeler-devel
Subject:    Re: Blob
From:       Andreas Zehender <zehender () kde ! org>
Date:       2001-11-04 12:18:30
[Download RAW message or body]

On Saturday 03 November 2001 21:04, lsk@if.ufrj.br wrote:

> > What's the use of the PMBlobCylinder::setRadius1, setEnd1 and setEnd2?
>
> because the rtti in pmcylinder is PMTCylinder and in pmlobcylinder is
> PMTBlobCylinder, so I had to overload the method

No, you don't have to. Each class in the object hierarchy has attributes and 
handles these attributes. Or do you handle the "hollow", "no_shadow" and 
"inverse" attributes in the blob cylinder because they are declared in the 
class PMSolidObject and you implement the class PMBlobCylinder?
No!
That's what the object type parameter is for in PMMemento::saveData.

> > Your code should not even compile because m_end1, m_end2 and m_radius
> > are
> > private member variables in PMCylinder and you use them in a base
> > class.
>
> Please, look the diffs of pmcylinder.h , m_end1, m_end2 and m_radius arent
> private any more, they are protected now. and yes, it compile, I tested.

Very bad style. Ever heared of the OO principle: encapsulation?

> > The attributes of PMCylinder are serialized (XML) in PMBlobCylinder (and
> > then
> > again in PMCylinder). Why?????
>
> I looked the output of xml document, the do well.

Yes, but the attributes are set twice.

> > Same for controlPoints( ) and controlPointsChanged( ) methods. You only
> > call
> > the methods of the base class. These methods are pointless!
>
> Because ther virtual methods, so I have the rewrite.

No! You only have to overwrite virtual functions if you want to change the 
behavior of the base class.

> Sory I do mathematics, some times I programming

I saw.

> ok, should I try to fix or throw away the code?

That's your choice.
But send me only code that follows the object oriented principles and is 
correct for povray. I can accept some mistakes but not as bad code as your 
last patch was.
It takes me as much time to fix your code as implementing it myself.

-- 
--------------------------------------------------
 Andreas Zehender, Dipl. Ing. (BA)
 Student, 9th semester computer science
 http://www.azweb.de
 az@azweb.de | zehender@kde.org      
--------------------------------------------------

List archive and information: http://mail.kde.org/mailman/listinfo/kpovmodeler-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic