Esempio n. 1
0
SlidingDoors::SlidingDoors ( double room_width, double room_height, double thickness ) {

  Slab *slab;

  this->room_width = room_width;
  this->room_height = room_height;

  // Panels
  left_panel = new Assembly();
  slab = new Slab( room_width, room_height * 5.0, thickness );
  left_panel->AddComponent( slab );
  slab = new Slab( HANDLE_SIZE, room_height * 5.0, HANDLE_SIZE );
  slab->SetOffset( room_width / 2.0 - HANDLE_SIZE / 2.0, 0.0, thickness / 2.0 + HANDLE_SIZE );
  slab->SetColor( RED );
  left_panel->AddComponent( slab );
  left_panel->SetOffset( - room_width / 2.0, room_height / 2.0, 0.0 );
  AddComponent( left_panel );

  right_panel = new Assembly();
  slab = new Slab( room_width, room_height * 5.0, thickness );
  right_panel->AddComponent( slab );
  right_panel->SetOffset( room_width / 2, room_height / 2.0, 0.0 );
  slab = new Slab( HANDLE_SIZE, room_height * 5.0, HANDLE_SIZE );
  slab->SetOffset( - room_width / 2.0 + HANDLE_SIZE / 2.0, 0.0, thickness / 2.0 + HANDLE_SIZE );
  slab->SetColor( RED ); 
  right_panel->AddComponent( slab );
  AddComponent( right_panel );

  SetPosition( 0.0, 0.0, 0.0 );
  SetColor( bulkhead_color );

}
Esempio n. 2
0
File: slab.cpp Progetto: B-Rich/NOVA
void Slab_cache::free (void *ptr)
{
    Lock_guard <Spinlock> guard (lock);

    Slab *slab = reinterpret_cast<Slab *>(reinterpret_cast<mword>(ptr) & ~PAGE_MASK);

    bool was_full = slab->full();

    slab->free (ptr);       // Deallocate from slab

    if (EXPECT_FALSE (was_full)) {

        // There are full slabs in front of us and we're partial; requeue
        if (slab->prev && slab->prev->full()) {

            // Dequeue
            slab->prev->next = slab->next;
            if (slab->next)
                slab->next->prev = slab->prev;

            // Enqueue after curr
            if (curr) {
                slab->prev = curr;
                slab->next = curr->next;
                curr->next = curr->next->prev = slab;
            }

            // Enqueue as head
            else {
                slab->prev = nullptr;
                slab->next = head;
                head = head->prev = slab;
            }
        }

        curr = slab;

    } else if (EXPECT_FALSE (slab->empty())) {

        // There are partial slabs in front of us and we're empty; requeue
        if (slab->prev && !slab->prev->empty()) {

            // Make partial slab in front of us current if we were current
            if (slab == curr)
                curr = slab->prev;

            // Dequeue
            slab->prev->next = slab->next;
            if (slab->next)
                slab->next->prev = slab->prev;

            // Enqueue as head
            slab->prev = nullptr;
            slab->next = head;
            head = head->prev = slab;
        }
    }
}
Esempio n. 3
0
PUBLIC
void *
Slab_cache::alloc()	// request initialized member from cache
{
  void *unused_block = 0;
  void *ret;
    {
      auto guard = lock_guard(lock);

      Slab *s = get_available_locked();

      if (EXPECT_FALSE(!s))
	{
	  guard.reset();

	  char *m = (char*)block_alloc(_slab_size, _slab_size);
	  Slab *new_slab = 0;
	  if (m)
	    new_slab = new (m + _slab_size - sizeof(Slab)) Slab(_elem_num, _entry_size, m);

	  guard.lock(&lock);

	  // retry gettin a slab that might be allocated by a different
	  // CPU meanwhile
	  s = get_available_locked();

	  if (!s)
	    {
	      // real OOM
	      if (!m)
		return 0;

	      _partial.add(new_slab);
	      s = new_slab;
	    }
	  else
	    unused_block = m;
	}

      ret = s->alloc();
      assert(ret);

      if (s->is_full())
	{
	  cxx::H_list<Slab>::remove(s);
	  _full.add(s);
	}
    }

  if (unused_block)
    block_free(unused_block, _slab_size);

  return ret;
}
Esempio n. 4
0
MarkerStructureGLObject *GraspGLObjects::CreateHandMarkerStructure ( char *model_file ) {

	Slab *bar;
	Assembly *frame, *square, *diamond;

	MarkerStructureGLObject *structure = new MarkerStructureGLObject( model_file );

	frame = new Assembly();

	square = new Assembly();
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   70.0, 0.0, 0.0 );
	square->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( - 70.0, 0.0, 0.0 );
	square->AddComponent( bar );
	bar = new Slab( 160.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 0.0, 70.0, 0.0 );
	square->AddComponent( bar );
	bar = new Slab( 160.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 0.0, -70.0, 0.0 );
	square->AddComponent( bar );

	frame->AddComponent( square );

	diamond = new Assembly();
	bar = new Slab( STRUCTURE_BAR_RADIUS, 80.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   35.0, 0.0, 0.0 );
	diamond->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 80.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( - 35.0, 0.0, 0.0 );
	diamond->AddComponent( bar );
	bar = new Slab( 80.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 0.0, 35.0, 0.0 );
	diamond->AddComponent( bar );
	bar = new Slab( 80.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 0.0, -35.0, 0.0 );
	diamond->AddComponent( bar );
	diamond->SetOrientation( 45.0, 0.0, 0.0 );
	diamond->SetPosition( 0.0, 0.0, -100.0 );

	frame->AddComponent( diamond );

	static double vertices[][2] = {{-100, -40}, {-100, 40}, {0, 70}, {100, 50}, {100, -50}, {0, -70}, {-100, -40}};
	Extrusion *plate = new Extrusion( 10.0, vertices, 7 );
	plate->SetOrientation( 0.0, 0.0, 90.0 );
	plate->SetPosition( -10.0, 0.0, 0.0 );
	frame->AddComponent( plate );

	square->SetColor( Translucid( GRAY ) );
	diamond->SetColor( Translucid( GRAY ) );
	plate->SetColor( Translucid( GRAY ) );
	frame->SetOffset( 0.0, 0.0, 70.0 );

	structure->AddComponent( frame );
	return( structure );
}
Esempio n. 5
0
Assembly *GraspGLObjects::CreateTorso( void ) {

	Assembly *torso = new Assembly();
	Slab *slab = new Slab( torso_shape[X], torso_shape[Y], torso_shape[Z] );
	slab->SetColor( 0.1f, 0.4f, 0.0f );
	torso->AddComponent( slab );
	Disk *disk = new Disk( 50.0 );
	disk->SetPosition( 0.0, 0.0, -40.0 );
	disk->SetColor( 1.0f, 0.7f, 0.0f );
	torso->AddComponent( disk );
	return torso;

}
Esempio n. 6
0
void MarkerStructureGLObject::AddBar( int marker1, int marker2 ) {

	Slab *slab;
	Vector3 center, delta;

	AddVectors( center, modelMarker[marker1].position, modelMarker[marker2].position );
	ScaleVector( center, center, 0.5 );
	SubtractVectors( delta, modelMarker[marker1].position, modelMarker[marker2].position );
	slab = new Slab( STRUCTURE_BAR_RADIUS, VectorNorm( delta ) * 1.1, STRUCTURE_BAR_RADIUS );
	slab->SetPosition( center[X], center[Y], center[Z] + STRUCTURE_BAR_RADIUS );
	slab->SetOrientation( ToDegrees( atan2( delta[X], delta[Y] ) ), 0.0, 0.0 );
	slab->SetColor( 1.0, 1.0, 0.0, 0.35 );
	AddComponent( slab );
}
Esempio n. 7
0
Assembly *GraspGLObjects::CreateCodaBar( double r, double g, double b ) {

	Assembly *coda = new Assembly();
	Slab *slab = new Slab( coda_shape[X], coda_shape[Y], coda_shape[Z] );
	slab->SetColor( r, g, b, 1.0 );
	coda->AddComponent( slab );
	for ( int lens = 0; lens < 3; lens ++ ) {
		slab = new Slab( coda_shape[X] / 10.0, coda_shape[Y] * 0.8, coda_shape[Z] );
		slab->SetPosition( ( 1 - lens ) * 0.4 * coda_shape[X], 0.0, - 10.0 );
		slab->SetColor( BLACK );
		coda->AddComponent( slab );
	}
	coda->SetOffset( - 0.4 * coda_shape[X], 0.0, 0.0 );
	coda->SetAttitude( 0.0, -90.0, 0.0 );
	return coda;

}
Esempio n. 8
0
PUBLIC
void
Slab_cache::free(void *cache_entry) // return initialized member to cache
{
  Slab *to_free = 0;
    {
      auto guard = lock_guard(lock);

      Slab *s = reinterpret_cast<Slab*>
	((reinterpret_cast<unsigned long>(cache_entry) & ~(_slab_size - 1)) + _slab_size - sizeof(Slab));

      bool was_full = s->is_full();

      s->free(cache_entry);

      if (was_full)
	{
	  cxx::H_list<Slab>::remove(s);
	  _partial.add(s);
	}
      else if (s->is_empty())
	{
	  cxx::H_list<Slab>::remove(s);
	  if (_num_empty < 2)
	    {
	      _empty.add(s);
	      ++_num_empty;
	    }
	  else
	    to_free = s;
	}
      else
	{
	  // We weren't either full or empty; we already had free
	  // elements.  This changes nothing in the queue, and there
	  // already must have been a _first_available_slab.
	}
    }

  if (to_free)
    {
      to_free->~Slab();
      block_free(reinterpret_cast<char *>(to_free + 1) - _slab_size, _slab_size);
    }
}
Esempio n. 9
0
Slab::Slab(const Slab& slab)
{
    m_typeID = slab.typeID();
    m_name = slab.name();
    m_width = slab.width();
    m_height = slab.height();
    m_colour = slab.colour();
    m_isCollided = slab.isCollided();
    setZValue(slab.zValue());

    setToolTip(m_name);
}
Esempio n. 10
0
MarkerStructureGLObject *GraspGLObjects::CreateHmdMarkerStructure ( char *model_file ) {

	MarkerStructureGLObject *structure = new MarkerStructureGLObject( model_file );

	Slab *bar;
	Assembly *frame = new Assembly();

	bar = new Slab( STRUCTURE_BAR_RADIUS, 100.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   0.0, 0.0, 0.0 );
	frame->AddComponent( bar );
	bar = new Slab( 210.0, STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS );
	bar->SetPosition(   0.0, 0.0, 0.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( 110.0, 0.0, 40.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, 160.0, STRUCTURE_BAR_RADIUS );
	bar->SetPosition( -110.0, 0.0, 40.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS, 40 );
	bar->SetPosition( -110.0, 0.0, 20.0 );
	frame->AddComponent( bar );
	bar = new Slab( STRUCTURE_BAR_RADIUS, STRUCTURE_BAR_RADIUS, 40 );
	bar->SetPosition( 110.0, 0.0, 20.0 );
	frame->AddComponent( bar );


	frame->SetPosition( 0.0, 0.0, -10.0 );

	structure->AddComponent( frame );


	structure->SetColor( Translucid( GRAY ) );
	//	structure->SetOrientation( 0.0, 0.0, 90.0 );
	return( structure );
}
Esempio n. 11
0
CODA::CODA( void ) {
	
	double near_vertex[3], far_vertex[3];
	double vergence;
	
	
	// Initialize standard parameters.
	reach = 3000.0;
	baseline = 600.0;
	toein = 7.0;
	fov = 70.0;
	
	// Create a structure to hold everything together.
	all = new Assembly();
	AddComponent( all );
	
	// Compute frustrum.
	vergence = radians( fov / 2.0 + toein );
	
	near_vertex[Z] = sin( PI / 2.0 - vergence ) * baseline / sin( 2.0 * vergence );
	near_vertex[X] = 0.0;
	near_vertex[Y] = near_vertex[Z] * tan( radians( fov / 2.0 ) );
	
	far_vertex[X] = reach * cos( PI / 2.0 - vergence ) - baseline / 2.0;
	far_vertex[Y] = reach * sin( PI / 2.0 - vergence );
	far_vertex[Z] = reach * sin( radians( fov / 2.0 ) );
	
	frustrum = new Frustrum( near_vertex, far_vertex );
	frustrum->SetColor( Translucid( MAGENTA ) );
	all->AddComponent( frustrum );
	
	// Create the camera bar objects.
	
	Slab *slab;
	double length = baseline + 120;
	
	body = new Slab( length, 120.0, 100.0);
	//  body->SetColor( GRAY );
	all->AddComponent( body );
	
	caps = new Assembly();
	slab = new Slab( 40.0, 140.0, 120.0 );
	slab->SetPosition( length / 2.0 + 20.0, 0.0, 0.0 );
	caps->AddComponent( slab );
	slab = new Slab( 40.0, 140.0, 120.0 );
	slab->SetPosition( - length / 2.0 - 20.0, 0.0, 0.0 );
	caps->AddComponent( slab );
	caps->SetColor( BLACK );
	all->AddComponent( caps );
	
	lenses = new Assembly();
	all->AddComponent( lenses );
	lenses->SetColor( BLACK );
	
	slab = new Slab( 140.0, 80.0, 40.0 );
	slab->SetPosition( - baseline / 2.0 + 20, 0.0, 50.0 );
	lenses->AddComponent( slab );
	
	slab = new Slab( 140.0, 80.0, 40.0 );
	slab->SetPosition( baseline / 2.0 - 20, 0.0, 50.0 );
	lenses->AddComponent( slab );
	
	slab = new Slab( 120.0, 80.0, 40.0 );
	slab->SetPosition( 0.0, 0.0, 50.0 );
	lenses->AddComponent( slab );
	
	slab = new Slab( 100.0, 80.0, 40.0 );
	slab->SetPosition( - baseline / 4.0, 0.0, 50.0 );
	lenses->AddComponent( slab );

	power_led = new Slab( 20, 10, 10 );
	power_led->SetPosition( - baseline / 4.0 - 20, - 20.0, 80.0 );
	power_led->SetColor( GREEN );
	lenses->AddComponent( power_led );

	acquire_led = new Slab( 20, 10, 10 );
	acquire_led->SetPosition( - baseline / 4.0 - 20, 20.0, 80.0 );
	acquire_led->SetColor( ORANGE );
	lenses->AddComponent( acquire_led );

	
	all->SetOrientation( 0.0, 90.0, 180.0 );
	
}
Esempio n. 12
0
ISS::ISS( ApertureType type, RoomTextures *tex, double width, double height, double length ) {


  // Object dimensions in the virtual world.
  // All values are in millimeters.

  // The rack is slightly smaller than the full height of the module.
  // This leaves a border top and bottom.
  rack_height =  1600.0; // Real height of Columbus module walls (rack) in mm.
  rack_width =   1000.0; // Real width of rack in mm.

  // The Columbus module is 2 x 2 x 8 meters wide.
  room_width  =  width;
  room_height =  height; 
  room_length =  length;
  wall_thickness = 250.0;

  float blank_color[4] = { 0.15, 0.15, 0.05, 1.0 };

//  char *rack_texture_file = "epm.bmp";

  Slab *slab;

 /* 
  * Define a viewing projection with:
  *  45° vertical field-of-view - horizontal fov will be determined by window aspect ratio.
  *  60 mm inter-pupilary distance - the units don't matter to OpenGL, but all the dimensions
  *      that I give for the model room here are in mm.
  *  10.0 to 10000.0  depth clipping planes - making this smaller would improve the depth resolution.
  */
  viewpoint = new Viewpoint( 6.0, 45.0, 10.0, 20000.0);

  /*
   * The rack texture is 256 pixels wide by 512 high.
   * We map this onto a patch that is 2 meters wide by 4 meter high in the virtual scene.
   * It then gets pasted on the left and right walls. The pattern is repeated to fill the
   *  entire wall from left to right. 
   * A neutral panel is added above and below to avoid gaps if the floor or ceiling are
   *  above or below the limits of the panel.
   */
//  rack_texture = new Texture( rack_texture_file, rack_width, rack_height );


  // Static objects in the room.

  SetColor( WHITE );
  SetPosition( 0.0, 0.0, 0.0 );

  // Right Wall
  right_wall = new Assembly;
  slab = new Slab( room_length, rack_height, wall_thickness );
  if ( tex ) slab->texture = tex->right;
//  slab->texture = rack_texture;
  right_wall->AddComponent( slab );

  // Extend Above
  slab = new Slab( room_length, rack_height, wall_thickness );
  slab->SetPosition( 0.0, rack_height, 0.0 );
  slab->SetColor( blank_color );
  right_wall->AddComponent( slab );

  // Extend Below
  slab = new Slab( room_length, rack_height, wall_thickness );
  slab->SetPosition( 0.0, - rack_height, 0.0 );
  slab->SetColor( blank_color );
  right_wall->AddComponent( slab );

  AddComponent( right_wall );
  right_wall->SetOffset( 0.0, room_height / 2.0, 0.0 );
  right_wall->SetPosition( ( room_width + wall_thickness ) / 2.0, 0.0, room_length / 2.0 );
  right_wall->SetOrientation( -90.0, j_vector );

// Left Wall
  left_wall = new Assembly;
  slab = new Slab( room_length, rack_height, wall_thickness );
  if ( tex ) slab->texture = tex->left;
//  slab->texture = rack_texture;
  left_wall->AddComponent( slab );

  // Extend Above
  slab = new Slab( room_length, rack_height, wall_thickness );
  slab->SetPosition( 0.0, rack_height, 0.0 );
  slab->SetColor( blank_color );
  left_wall->AddComponent( slab );

  // Extend Below
  slab = new Slab( room_length, rack_height, wall_thickness );
  slab->SetPosition( 0.0, - rack_height, 0.0 );
  slab->SetColor( blank_color );
  left_wall->AddComponent( slab );

  AddComponent( left_wall );
  left_wall->SetOffset( 0.0 , room_height / 2.0, 0.0 );
  left_wall->SetPosition( ( - room_width - wall_thickness ) / 2, 0.0, room_length / 2.0 );
  left_wall->SetOrientation( 90.0, j_vector );

  // Create a ceiling. 
  // Make it wide enough so as not to see the left and right edges.
  // The dimension Y sets the far edge in depth.
  ceiling = new Slab( 6.0 * room_width, room_length, wall_thickness );
  ceiling->SetOffset( 0.0,0.0, wall_thickness / 2 );
  ceiling->SetPosition( room_width / 2.0, rack_height, 0.0 );
  ceiling->SetOrientation( 90.0, i_vector );
  ceiling->SetColor( WHITE );
  if ( tex ) ceiling->texture = tex->ceiling;
  AddComponent( ceiling );

  // Floor
//  deck = new Slab( 6.0 * room_width, 2.0 * room_length, wall_thickness );
//  deck = new Slab( 6.0 * room_width, 2.0 * room_length, wall_thickness );
  deck = new Slab( 6.0 * room_width, 1.1 * room_length, wall_thickness );
  deck->SetColor( WHITE );
  deck->SetOffset( 0.0,0.0, wall_thickness / 2 );
  deck->SetPosition( - room_width / 2.0, 0.0, 0.0 );
  deck->SetOrientation( -90.0, i_vector );
  if ( tex ) deck->texture = tex->floor;
  AddComponent( deck );

  // Background
  if ( tex ) {
    if ( tex->rear ) {
      backdrop = new Patch( 6.0 * room_width, 6.0 * room_height );
      backdrop->SetPosition( 0.0, 0.0, - room_length );
      backdrop->SetTexture( tex->front );
      AddComponent( backdrop );
    }
  }

  /*
   * Create the doorway.
   */

  switch ( type ) {

  case SLIDING:
    doorway = new SlidingDoors( room_width, room_height, wall_thickness );
    break;

  case HUBLOT:
    doorway = new Hublot( room_width, room_height, wall_thickness );
    break;

  }
  doorway->SetColor( bulkhead_color );
  AddComponent( doorway );


  SetAperture( 1000.0 );
  SetPerceivedEH( .75 * rack_height );
  SetPerceivedDistance( 3000.0 );

}
Esempio n. 13
0
Dial::Dial ( void ) {

  thickness = 10.0;
  radius = 100.0;
  tilt = 30.0;
  label_width = 50.0;

  Slab *slab;
  Disk *disk;
  Cylinder *cylinder;
  Patch *rectangle;
	char path[1024];

	sprintf( path, "%s%s", AfdTexturePath, "bmp\\ten.bmp" );
  ten_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\five.bmp" );
  five_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\zero.bmp" );
  zero_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\meters.bmp" );
  meters_texture = new Texture( path, label_width * 2.0, label_width / 2.0 );
  
  needle = new Slab( thickness / 4.0, 0.90 * radius, thickness / 2.0 );
  needle->SetOffset( 0.0, radius / 2.0, thickness / 2.0 );
  needle->SetColor( ORANGE );
  AddComponent( needle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( radius + label_width / 2.0, 0.0, 0.0 );
  rectangle->SetTexture( ten_texture );
  AddComponent( rectangle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( 0.0, radius + label_width / 2.0, 0.0 );
  rectangle->SetTexture( five_texture );
  AddComponent( rectangle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( - ( radius + label_width / 2.0 ), 0.0, 0.0 );
  rectangle->SetTexture( zero_texture );
  AddComponent( rectangle );

  rectangle = new Patch( 2 * label_width , label_width / 2.0 );
  rectangle->SetPosition( 0.0, - radius - label_width / 2.0, 0.0 );
  rectangle->SetTexture( meters_texture );
//  AddComponent( rectangle );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -18.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -36.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -54.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -72.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -90.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 18.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 36.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 54.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 72.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 90.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  disk = new Disk( radius );
  AddComponent( disk );
  cylinder = new Cylinder( radius, radius, thickness );
  AddComponent( cylinder );
  
  SetColor( CYAN );
  SetAttitude( tilt, i_vector );

  minimum = 0.0;
  maximum = 10000;

}