<commit_before>//
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2013 Project Chrono
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file at the top level of the distribution
// and at http://projectchrono.org/license-chrono.txt.
//
// Author: A.Tasora

#ifndef CHLINESHAPE_H
#define CHLINESHAPE_H

#include "assets/ChVisualization.h"
#include "geometry/ChCLine.h"
#include "geometry/ChCLineSegment.h"

namespace chrono {

/// Class for referencing a ChLine that can be
/// visualized in some way.

class ChApi ChLineShape : public ChVisualization {
    // Chrono RTTI, needed for serialization
    CH_RTTI(ChLineShape, ChVisualization);

  protected:
    //
    // DATA
    //
    ChSharedPtr<geometry::ChLine> gline;

  public:
    //
    // CONSTRUCTORS
    //

    ChLineShape() {
        // default path
        gline = ChSharedPtr<geometry::ChLine>(new geometry::ChLineSegment);
    };
    ChLineShape(ChSharedPtr<geometry::ChLine>& mline) : gline(mline){};

    virtual ~ChLineShape(){};

    //
    // FUNCTIONS
    //

    // Access the line geometry
    ChSharedPtr<geometry::ChLine> GetLineGeometry() { return gline; }

    // Set the line geometry
    void SetLineGeometry(ChSharedPtr<geometry::ChLine> mline) { gline = mline; }


    //
    // SERIALIZATION
    //

    virtual void ArchiveOUT(ChArchiveOut& marchive)
    {
        // version number
        marchive.VersionWrite(1);
        // serialize parent class
        ChVisualization::ArchiveOUT(marchive);
        // serialize all member data:
        marchive << CHNVP(gline);
    }

    /// Method to allow de serialization of transient data from archives.
    virtual void ArchiveIN(ChArchiveIn& marchive) 
    {
        // version number
        int version = marchive.VersionRead();
        // deserialize parent class
        ChVisualization::ArchiveIN(marchive);
        // stream in all member data:
        marchive >> CHNVP(gline);
    }
};

//////////////////////////////////////////////////////
//////////////////////////////////////////////////////

}  // END_OF_NAMESPACE____

#endif
<commit_msg>Add `name` member variable to ChLineShape.<commit_after>//
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2013 Project Chrono
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file at the top level of the distribution
// and at http://projectchrono.org/license-chrono.txt.
//
// Author: A.Tasora

#ifndef CHLINESHAPE_H
#define CHLINESHAPE_H

#include "assets/ChVisualization.h"
#include "geometry/ChCLine.h"
#include "geometry/ChCLineSegment.h"

namespace chrono {

/// Class for referencing a ChLine that can be
/// visualized in some way.

class ChApi ChLineShape : public ChVisualization {
    // Chrono RTTI, needed for serialization
    CH_RTTI(ChLineShape, ChVisualization);

  protected:
    //
    // DATA
    //
    ChSharedPtr<geometry::ChLine> gline;
    std::string name;

  public:
    //
    // CONSTRUCTORS
    //

    ChLineShape() {
        // default path
        gline = ChSharedPtr<geometry::ChLine>(new geometry::ChLineSegment);
    };
    ChLineShape(ChSharedPtr<geometry::ChLine>& mline) : gline(mline){};

    virtual ~ChLineShape(){};

    //
    // FUNCTIONS
    //

    // Access the line geometry
    ChSharedPtr<geometry::ChLine> GetLineGeometry() { return gline; }

    // Set the line geometry
    void SetLineGeometry(ChSharedPtr<geometry::ChLine> mline) { gline = mline; }

    const std::string& GetName() const { return name; }
    void SetName(const std::string& mname) { name = mname; }

    //
    // SERIALIZATION
    //

    virtual void ArchiveOUT(ChArchiveOut& marchive)
    {
        // version number
        marchive.VersionWrite(1);
        // serialize parent class
        ChVisualization::ArchiveOUT(marchive);
        // serialize all member data:
        marchive << CHNVP(gline);
    }

    /// Method to allow de serialization of transient data from archives.
    virtual void ArchiveIN(ChArchiveIn& marchive) 
    {
        // version number
        int version = marchive.VersionRead();
        // deserialize parent class
        ChVisualization::ArchiveIN(marchive);
        // stream in all member data:
        marchive >> CHNVP(gline);
    }
};

//////////////////////////////////////////////////////
//////////////////////////////////////////////////////

}  // END_OF_NAMESPACE____

#endif

{'fraction_non_alphanumeric': 0.15501990269792126, 'fraction_numerical': 0.0022114108801415304, 'mean_word_length': 2.189703808180536, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2623860', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1301, 'n_words': 347}