BioDynaMo  v1.05.159-3be850bb
neuron_or_neurite.cc
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
18 
19 namespace bdm {
20 namespace neuroscience {
21 
23 
25  const {
26  if (auto* neuron = dynamic_cast<const NeuronSoma*>(this)) {
27  return neuron->template GetAgentPtr<NeuronOrNeurite>();
28  } else if (auto* neurite = dynamic_cast<const NeuriteElement*>(this)) {
29  return neurite->template GetAgentPtr<NeuronOrNeurite>();
30  }
31  assert(false && "This code should not be reached.");
33 }
34 
36  if (IsNeuronSoma()) {
38  } else {
40  }
41 };
42 
44  return dynamic_cast<const NeuronSoma*>(this) != nullptr;
45 }
46 
48  return dynamic_cast<const NeuriteElement*>(this) != nullptr;
49 }
50 
51 } // namespace neuroscience
52 } // namespace bdm
AgentPointer< NeuronOrNeurite > GetNeuronOrNeuriteAgentPtr() const
virtual StructureIdentifierSWC GetIdentifierSWC() const
Returns the SWC classification of the object.
Definition: agent.cc:39