head	1.13;
access;
symbols
	r2_1:1.11
	r2_0:1.11
	r1_1_beta:1.10
	r1_1_alpha:1.9
	r1_0:1.9
	r0_11:1.8
	r0_10:1.8
	r0_9:1.8
	Eglin_alpha_1:1.8;
locks; strict;
comment	@// @;


1.13
date	94.12.01.16.04.02;	author fjsoria;	state Exp;
branches;
next	1.12;

1.12
date	94.11.01.19.18.36;	author fjsoria;	state Exp;
branches;
next	1.11;

1.11
date	94.08.18.23.39.28;	author thoth;	state Exp;
branches;
next	1.10;

1.10
date	94.07.25.17.00.05;	author thoth;	state Exp;
branches;
next	1.9;

1.9
date	94.05.08.19.37.14;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	93.05.26.16.51.46;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	93.05.19.14.45.15;	author thoth;	state Exp;
branches;
next	1.6;

1.6
date	92.12.16.14.48.21;	author thoth;	state Exp;
branches;
next	1.5;

1.5
date	92.11.15.15.58.16;	author thoth;	state Exp;
branches;
next	1.4;

1.4
date	92.11.11.12.17.42;	author thoth;	state Exp;
branches;
next	1.3;

1.3
date	92.11.04.12.00.07;	author thoth;	state Exp;
branches;
next	1.2;

1.2
date	92.10.25.20.55.59;	author thoth;	state Exp;
branches;
next	1.1;

1.1
date	92.10.21.14.58.47;	author thoth;	state Exp;
branches;
next	;


desc
@a structure describing the derivation of a binary set operation
@


1.13
log
@__NO_OUTLINE_DESTRUCTORS
changed from __NO_INLINE_DESTRUCTORS
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


// 
// $Log: SetStructure.h,v $
// Revision 1.12  1994/11/01  19:18:36  fjsoria
// non-inlined destructor fixed for g++
//
// Revision 1.11  1994/08/18  23:39:28  thoth
// DOS-inspired filename rework
//
// Revision 1.10  1994/07/25  17:00:05  thoth
// Name sanitization.
//
// Revision 1.9  1994/05/08  19:37:14  thoth
// New intpointset decomposition capability.
//
// Revision 1.8  1993/05/26  16:51:46  thoth
// Copyright Notices
//
// Revision 1.7  93/05/19  14:45:15  thoth
// now named IA_Array
// 
// Revision 1.6  92/12/16  14:48:21  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.5  92/11/15  15:58:16  thoth
// expect a slight performance increase with preallocation.
// 
// Revision 1.4  92/11/11  12:17:42  thoth
// incremental optimization of SetStructures.
// 
// Revision 1.3  92/11/04  12:00:07  thoth
// new != comparator.
// bugfix relating to optimization of termination constans.
// 
// Revision 1.2  92/10/25  20:55:59  thoth
// made recursion termination constants have sensible names.
// 
// Revision 1.1  92/10/21  14:58:47  thoth
// Initial revision
// 
//

#ifndef SetStructure_h_
#define SetStructure_h_

#include "Array.h"
#include "IntPS.h"

struct IA_real_ss;
struct IA_ss_interval;

struct IA_SetStructure {
  public:
    static const IA_SetStructure	FIRST_ONLY;
    static const IA_SetStructure	SECOND_ONLY;
    static const IA_SetStructure	BOTH;
  private:
    IA_real_ss	*val;
    void copy_on_write();
    
    // verboten
    IA_SetStructure(IA_real_ss *);
  public:
    IA_SetStructure();
    IA_SetStructure(const IA_SetStructure &ss);

#ifdef __NO_OUTLINE_DESTRUCTORS
    void DestroySetStructure(); 
    ~IA_SetStructure() { DestroySetStructure(); }
#else  
    ~IA_SetStructure();
#endif

    
    IA_SetStructure & operator=(const IA_SetStructure&);
    
    int operator==(const IA_SetStructure& rhs) const { return val == rhs.val; }
    int operator!=(const IA_SetStructure& rhs) const { return val != rhs.val; }
    
    void add_interval(unsigned, IA_SetStructure);
    IA_ss_interval retrieve_interval(unsigned idx) const;
    unsigned nintervals() const;
    void ensure_space(unsigned);
};


struct IA_ss_interval {
    unsigned	count;
    IA_SetStructure	substructure;
    IA_ss_interval() 
    :substructure() { count=0; }
};

struct IA_real_ss {
  private:
    // verboten
    IA_real_ss& operator=(const IA_real_ss&);
  public:
    IA_Array<IA_ss_interval>	ivls;
    int		refcount;
    IA_real_ss()
    :ivls(0) { refcount = 1;}
    IA_real_ss(const IA_real_ss &arg) 
    :ivls(arg.ivls) { refcount=1; }
    IA_real_ss(double) 
    :ivls(1) { refcount=1; ivls.lengthen(2); }
    // the default destructor is correct
};


//
//

/* This structure represents the decomposition of a Yoder that has
   only two shadows, the empty pointset and the plate below.

   Condition 1
   If plate.card() ever turns out to be 1, the one point should be the
   origin.  This way the minkowski sum of bar and plate will == bar.
   This is for optimization purposes.

   Condition 2
   If bar.card()==1 then plate should be the set containing only the
   origin.  Otherwise bar should chase down the decomposition chain.
   This is for optimization purposes.

   */
struct IA_decomp_frag {
    /* This pointset is a subset of a 1-d line that is parallel to one
       of the coordinate axes. */
    IA_Set<IA_Point<int> >	bar;

    /* The minkowski sum of bar and plate is the pointset we decomposed */
    IA_Set<IA_Point<int> >	plate;
};

struct IA_PointSetDecomposition {
private:
    IA_Array<IA_decomp_frag>	fragments;
public:
    IA_PointSetDecomposition() {}
    IA_PointSetDecomposition(const IA_Set<IA_Point<int> > &);

    int nfragments() const { return fragments.len(); }

    IA_decomp_frag get_frag(int idx);
};

#endif
@


1.12
log
@non-inlined destructor fixed for g++
@
text
@d11 3
d74 1
a74 1
#ifdef __NO_INLINE_DESTRUCTORS
@


1.11
log
@DOS-inspired filename rework
@
text
@d11 3
d70 5
d76 3
d90 1
d113 1
@


1.10
log
@Name sanitization.
@
text
@d11 3
d48 1
a48 1
#include "IntPointSet.h"
@


1.9
log
@New intpointset decomposition capability.
@
text
@d11 3
d119 1
a119 1
    IA_IntPointSet	bar;
d122 1
a122 1
    IA_IntPointSet	plate;
d130 1
a130 1
    IA_PointSetDecomposition(const IA_IntPointSet &);
@


1.8
log
@Copyright Notices
@
text
@d10 4
a13 1
// $Log:	SetStructure.h,v $
d42 1
d94 38
@


1.7
log
@now named IA_Array
@
text
@d3 6
d11 3
@


1.6
log
@conversion to IA_ mostly complete
@
text
@d5 3
d35 23
a57 23
public:
  static const IA_SetStructure	FIRST_ONLY;
  static const IA_SetStructure	SECOND_ONLY;
  static const IA_SetStructure	BOTH;
private:
  IA_real_ss	*val;
  void copy_on_write();

  // verboten
  IA_SetStructure(IA_real_ss *);
public:
  IA_SetStructure();
  IA_SetStructure(const IA_SetStructure &ss);
  ~IA_SetStructure();
  IA_SetStructure & operator=(const IA_SetStructure&);

  int operator==(const IA_SetStructure& rhs) const { return val == rhs.val; }
  int operator!=(const IA_SetStructure& rhs) const { return val != rhs.val; }

  void add_interval(unsigned, IA_SetStructure);
  IA_ss_interval retrieve_interval(unsigned idx) const;
  unsigned nintervals() const;
  void ensure_space(unsigned);
d61 4
a64 4
  unsigned	count;
  IA_SetStructure	substructure;
  IA_ss_interval() 
  :substructure() { count=0; }
d68 13
a80 13
private:
  // verboten
  IA_real_ss& operator=(const IA_real_ss&);
public:
  Array<IA_ss_interval>	ivls;
  int		refcount;
  IA_real_ss()
  :ivls(0) { refcount = 1;}
  IA_real_ss(const IA_real_ss &arg) 
  :ivls(arg.ivls) { refcount=1; }
  IA_real_ss(double) 
  :ivls(1) { refcount=1; ivls.lengthen(2); }
  // the default destructor is correct
@


1.5
log
@expect a slight performance increase with preallocation.
@
text
@d5 3
d28 2
a29 2
struct real_ss;
struct ss_interval;
d31 1
a31 1
struct SetStructure {
d33 3
a35 3
  static const SetStructure	FIRST_ONLY;
  static const SetStructure	SECOND_ONLY;
  static const SetStructure	BOTH;
d37 1
a37 1
  real_ss	*val;
d41 1
a41 1
  SetStructure(real_ss *);
d43 4
a46 4
  SetStructure();
  SetStructure(const SetStructure &ss);
  ~SetStructure();
  SetStructure & operator=(const SetStructure&);
d48 2
a49 2
  int operator==(const SetStructure& rhs) const { return val == rhs.val; }
  int operator!=(const SetStructure& rhs) const { return val != rhs.val; }
d51 2
a52 2
  void add_interval(unsigned, SetStructure);
  ss_interval retrieve_interval(unsigned idx) const;
d57 1
a57 1
struct ss_interval {
d59 2
a60 2
  SetStructure	substructure;
  ss_interval() 
d64 1
a64 1
struct real_ss {
d67 1
a67 1
  real_ss& operator=(const real_ss&);
d69 1
a69 1
  Array<ss_interval>	ivls;
d71 1
a71 1
  real_ss()
d73 1
a73 1
  real_ss(const real_ss &arg) 
d75 1
a75 1
  real_ss(double) 
@


1.4
log
@incremental optimization of SetStructures.
@
text
@d5 3
d51 1
@


1.3
log
@new != comparator.
bugfix relating to optimization of termination constans.
@
text
@d5 4
d69 1
a69 1
  :ivls(1) { refcount=1; ivls.lengthen(1); }
@


1.2
log
@made recursion termination constants have sensible names.
@
text
@d5 3
d39 1
d64 2
@


1.1
log
@Initial revision
@
text
@d4 4
a7 1
// $Log:	IntPointSet.h,v $
d20 2
a21 3
  static const SetStructure	NEITHER;
  static const SetStructure	FIRST;
  static const SetStructure	SECOND;
a23 1
  unsigned	dimensions;
d25 1
a25 1
  void cow();
d30 1
a30 1
  SetStructure(unsigned dim);
d46 1
a46 1
  :substructure(0U) { count=0; }
d57 1
a57 1
  :ivls(0) {refcount = 1;}
d59 2
a60 1
  :ivls(arg.ivls) { refcount=0; }
@
