More cleanup and BList -> BObjectList.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,8 +32,9 @@ class BALMLayout;
|
||||
* Rectangular area in the GUI, defined by a tab on each side.
|
||||
*/
|
||||
class Area {
|
||||
|
||||
public:
|
||||
~Area();
|
||||
|
||||
XTab* Left() const;
|
||||
void SetLeft(XTab* left);
|
||||
XTab* Right() const;
|
||||
@@ -71,7 +72,8 @@ public:
|
||||
BAlignment Alignment() const;
|
||||
void SetAlignment(BAlignment alignment);
|
||||
void SetHorizontalAlignment(alignment horizontal);
|
||||
void SetVerticalAlignment(vertical_alignment vertical);
|
||||
void SetVerticalAlignment(
|
||||
vertical_alignment vertical);
|
||||
|
||||
int32 LeftInset() const;
|
||||
void SetLeftInset(int32 left);
|
||||
@@ -93,8 +95,6 @@ public:
|
||||
Constraint* HasSameHeightAs(Area* area);
|
||||
BList* HasSameSizeAs(Area* area);
|
||||
|
||||
~Area();
|
||||
|
||||
protected:
|
||||
Area(BALMLayout* ls, XTab* left, YTab* top,
|
||||
XTab* right, YTab* bottom,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Copyright 2007-2008, James Kim, [email protected]
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#ifndef BALM_LAYOUT_H
|
||||
#define BALM_LAYOUT_H
|
||||
|
||||
@@ -14,14 +13,13 @@
|
||||
#include <SupportDefs.h>
|
||||
#include <View.h>
|
||||
|
||||
#include "Area.h"
|
||||
#include "Column.h"
|
||||
#include "LayoutStyleType.h"
|
||||
#include "LinearSpec.h"
|
||||
#include "Row.h"
|
||||
#include "XTab.h"
|
||||
#include "YTab.h"
|
||||
#include "Area.h"
|
||||
#include "Row.h"
|
||||
#include "Column.h"
|
||||
#include "Constraint.h"
|
||||
#include "LinearSpec.h"
|
||||
|
||||
|
||||
namespace BALM {
|
||||
@@ -30,7 +28,6 @@ namespace BALM {
|
||||
* A GUI layout engine using the ALM.
|
||||
*/
|
||||
class BALMLayout : public BAbstractLayout, public LinearSpec {
|
||||
|
||||
public:
|
||||
BALMLayout();
|
||||
void SolveLayout();
|
||||
|
||||
@@ -99,6 +99,7 @@ typedef BObjectList<Constraint> ConstraintList;
|
||||
} // namespace LinearProgramming
|
||||
|
||||
using LinearProgramming::Constraint;
|
||||
using LinearProgramming::ConstraintList;
|
||||
|
||||
#endif // CONSTRAINT_H
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include "Constraint.h"
|
||||
|
||||
#include "OperatorType.h"
|
||||
#include "OptimizationType.h"
|
||||
#include "PenaltyFunction.h"
|
||||
@@ -25,14 +24,9 @@
|
||||
|
||||
#include "lp_lib.h"
|
||||
|
||||
|
||||
namespace LinearProgramming {
|
||||
|
||||
class Constraint;
|
||||
class ObjFunctionSummand;
|
||||
class PenaltyFunction;
|
||||
class Variable;
|
||||
|
||||
|
||||
/*!
|
||||
* Specification of a linear programming problem.
|
||||
*/
|
||||
@@ -106,8 +100,8 @@ public:
|
||||
void GetString(BString& string) const;
|
||||
|
||||
protected:
|
||||
BList* Variables() const;
|
||||
BList* Constraints() const;
|
||||
VariableList* Variables() const;
|
||||
ConstraintList* Constraints() const;
|
||||
|
||||
int32 fCountColumns;
|
||||
|
||||
@@ -116,8 +110,8 @@ private:
|
||||
OptimizationType fOptimization;
|
||||
lprec* fLP;
|
||||
SummandList* fObjFunction;
|
||||
BList fVariables;
|
||||
BList fConstraints;
|
||||
VariableList fVariables;
|
||||
ConstraintList fConstraints;
|
||||
ResultType fResult;
|
||||
double fObjectiveValue;
|
||||
double fSolvingTime;
|
||||
|
||||
@@ -76,8 +76,13 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef BObjectList<Variable> VariableList;
|
||||
|
||||
|
||||
} // namespace LinearProgramming
|
||||
|
||||
using LinearProgramming::Variable;
|
||||
using LinearProgramming::VariableList;
|
||||
|
||||
#endif // VARIABLE_H
|
||||
|
||||
@@ -542,10 +542,10 @@ LinearSpec::SetOptimization(OptimizationType value)
|
||||
*
|
||||
* @return the variables
|
||||
*/
|
||||
BList*
|
||||
VariableList*
|
||||
LinearSpec::Variables() const
|
||||
{
|
||||
return const_cast<BList*>(&fVariables);
|
||||
return const_cast<VariableList*>(&fVariables);
|
||||
}
|
||||
|
||||
|
||||
@@ -554,10 +554,10 @@ LinearSpec::Variables() const
|
||||
*
|
||||
* @return the constraints
|
||||
*/
|
||||
BList*
|
||||
ConstraintList*
|
||||
LinearSpec::Constraints() const
|
||||
{
|
||||
return const_cast<BList*>(&fConstraints);
|
||||
return const_cast<ConstraintList*>(&fConstraints);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -289,11 +289,10 @@ Variable::Invalidate()
|
||||
fLS->Variables()->RemoveItem(this);
|
||||
|
||||
// invalidate all constraints that use this variable
|
||||
BList markedForInvalidation;
|
||||
BList* constraints = fLS->Constraints();
|
||||
ConstraintList markedForInvalidation;
|
||||
ConstraintList* constraints = fLS->Constraints();
|
||||
for (int i = 0; i < constraints->CountItems(); i++) {
|
||||
Constraint* constraint = static_cast<Constraint*>(
|
||||
constraints->ItemAt(i));
|
||||
Constraint* constraint = constraints->ItemAt(i);
|
||||
|
||||
if (!constraint->IsValid())
|
||||
continue;
|
||||
@@ -308,8 +307,7 @@ Variable::Invalidate()
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < markedForInvalidation.CountItems(); i++)
|
||||
static_cast<Constraint*>(markedForInvalidation.ItemAt(i))
|
||||
->Invalidate();
|
||||
markedForInvalidation.ItemAt(i)->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user