<commit_before>/*=========================================================================

  Program: Bender

  Copyright (c) Kitware Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0.txt

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

=========================================================================*/

#ifndef __vtkDoubleConeBoneRepresentation_h
#define __vtkDoubleConeBoneRepresentation_h

// Cone1's base on point 1 and cone2's base on point2

#include "vtkBoneRepresentation.h"
#include "vtkBoneWidgetHeader.h"

class vtkActor;
class vtkAppendPolyData;
class vtkPolyDataMapper;
class vtkConeSource;
class vtkProperty;
class vtkPolyData;
class vtkTubeFilter;

class VTK_BONEWIDGETS_EXPORT vtkDoubleConeBoneRepresentation : public vtkBoneRepresentation
{
public:

  // Description:
  // Instantiate this class.
  static vtkDoubleConeBoneRepresentation *New();

  // Description:
  // Standard methods for the class.
  vtkTypeMacro(vtkDoubleConeBoneRepresentation, vtkBoneRepresentation);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Methods to Set/Get the coordinates of the two points defining
  // this representation. Note that methods are available for both
  // display and world coordinates.
  virtual void SetPoint1WorldPosition(double pos[3]);
  virtual void SetPoint2WorldPosition(double pos[3]);

  // Description:
  void GetPolyData(vtkPolyData *pd);

  // Description:
  // These are methods that satisfy vtkWidgetRepresentation's API.
  virtual void BuildRepresentation();
  virtual double *GetBounds();

  vtkGetMacro(Radius,double);

  // Description:
  // Min 0.0001
  void SetCapping (int capping);
  vtkGetMacro(Capping, int);
  
  // Description:
  //Set the shar ratio between the 2 cones. If set to 0,
  // cone1 takes the whole line. If set to 1, Cone2 take the whole line
  void SetRatio (double ratio);
  vtkGetMacro(Ratio,double);

  // Description:
  // Minimum 3
  void SetNumberOfSides(int numberOFSides);
  vtkGetMacro(NumberOfSides, int);

  // Description:
  // Get the cylinder properties. The properties of the cones when selected
  // and unselected can be manipulated.
  vtkGetObjectMacro(ConesProperty,vtkProperty);
  //vtkGetObjectMacro(SelectedCone1Property,vtkProperty);

  // Description:
  // Methods supporting the rendering process.
  virtual void GetActors(vtkPropCollection *pc);
  virtual void ReleaseGraphicsResources(vtkWindow*);
  virtual int RenderOpaqueGeometry(vtkViewport*);
  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
  virtual int HasTranslucentPolygonalGeometry();
  
protected:
  vtkDoubleConeBoneRepresentation();
  ~vtkDoubleConeBoneRepresentation();

  // the Cylinder
  vtkActor*          ConesActor;
  vtkPolyDataMapper* ConesMapper;
  vtkConeSource*     Cone1;
  vtkConeSource*     Cone2;
  vtkAppendPolyData* GlueFilter;

  // Properties used to control the appearance of selected objects and
  // the manipulator in general.
  vtkProperty* ConesProperty;
  void         CreateDefaultProperties();

  // Ivars used during widget interaction to hold initial positions
  double StartCylinderHandle[3];

  //Cone properties
  double Radius;
  int    NumberOfSides;
  double Ratio;
  int    Capping;

  void GlueCones();
  void RebuildCones();

private:
  vtkDoubleConeBoneRepresentation(const vtkDoubleConeBoneRepresentation&);  //Not implemented
  void operator=(const vtkDoubleConeBoneRepresentation&);  //Not implemented<commit_msg>ENH: Double cone Representation - alphabetical order for the includes<commit_after>/*=========================================================================

  Program: Bender

  Copyright (c) Kitware Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0.txt

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

=========================================================================*/

#ifndef __vtkDoubleConeBoneRepresentation_h
#define __vtkDoubleConeBoneRepresentation_h

// Cone1's base on point 1 and cone2's base on point2

#include "vtkBoneRepresentation.h"
#include "vtkBoneWidgetHeader.h"

class vtkActor;
class vtkAppendPolyData;
class vtkConeSource;
class vtkPolyDataMapper;
class vtkPolyData;
class vtkProperty;
class vtkTubeFilter;

class VTK_BONEWIDGETS_EXPORT vtkDoubleConeBoneRepresentation : public vtkBoneRepresentation
{
public:

  // Description:
  // Instantiate this class.
  static vtkDoubleConeBoneRepresentation *New();

  // Description:
  // Standard methods for the class.
  vtkTypeMacro(vtkDoubleConeBoneRepresentation, vtkBoneRepresentation);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Methods to Set/Get the coordinates of the two points defining
  // this representation. Note that methods are available for both
  // display and world coordinates.
  virtual void SetPoint1WorldPosition(double pos[3]);
  virtual void SetPoint2WorldPosition(double pos[3]);

  // Description:
  void GetPolyData(vtkPolyData *pd);

  // Description:
  // These are methods that satisfy vtkWidgetRepresentation's API.
  virtual void BuildRepresentation();
  virtual double *GetBounds();

  vtkGetMacro(Radius,double);

  // Description:
  // Min 0.0001
  void SetCapping (int capping);
  vtkGetMacro(Capping, int);
  
  // Description:
  //Set the shar ratio between the 2 cones. If set to 0,
  // cone1 takes the whole line. If set to 1, Cone2 take the whole line
  void SetRatio (double ratio);
  vtkGetMacro(Ratio,double);

  // Description:
  // Minimum 3
  void SetNumberOfSides(int numberOFSides);
  vtkGetMacro(NumberOfSides, int);

  // Description:
  // Get the cylinder properties. The properties of the cones when selected
  // and unselected can be manipulated.
  vtkGetObjectMacro(ConesProperty,vtkProperty);
  //vtkGetObjectMacro(SelectedCone1Property,vtkProperty);

  // Description:
  // Methods supporting the rendering process.
  virtual void GetActors(vtkPropCollection *pc);
  virtual void ReleaseGraphicsResources(vtkWindow*);
  virtual int RenderOpaqueGeometry(vtkViewport*);
  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
  virtual int HasTranslucentPolygonalGeometry();
  
protected:
  vtkDoubleConeBoneRepresentation();
  ~vtkDoubleConeBoneRepresentation();

  // the Cylinder
  vtkActor*          ConesActor;
  vtkPolyDataMapper* ConesMapper;
  vtkConeSource*     Cone1;
  vtkConeSource*     Cone2;
  vtkAppendPolyData* GlueFilter;

  // Properties used to control the appearance of selected objects and
  // the manipulator in general.
  vtkProperty* ConesProperty;
  void         CreateDefaultProperties();

  //Cone properties
  double Radius;
  int    NumberOfSides;
  double Ratio;
  int    Capping;

  void GlueCones();
  void RebuildCones();

private:
  vtkDoubleConeBoneRepresentation(const vtkDoubleConeBoneRepresentation&);  //Not implemented
  void operator=(const vtkDoubleConeBoneRepresentation&);  //Not implemented
{'fraction_non_alphanumeric': 0.10926640926640926, 'fraction_numerical': 0.006821106821106821, 'mean_word_length': 4.550714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6597808', 'n_tokens_mistral': 2304, 'n_tokens_neox': 2215, 'n_words': 700}